[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string manipulation
Mark Hadfield wrote:
>
> "JD Smith" <jdsmith@astro.cornell.edu> wrote in message
> 3A9C2CF5.F632B1AF@astro.cornell.edu">news:3A9C2CF5.F632B1AF@astro.cornell.edu...
> > [...]
> > new=strmid(key,0,transpose(p1))+'50'+strmid(key,tranpose(p2))
> >
> > The key is putting the threading vector on its head, as a column
> > vector.
>
> Aaaaagh! The major reason I hate Matlab is all the "Have I got a row vector
> or a column vector?" rubbish! I feel like picking it up & shaking it &
> saying, "No, it's not a matrix, it's not a column vector, it's not a row
> vector, it's just a list of numbers. It's not dimensioned (n,1) and it's not
> dimensioned (1,n), it's dimensioned (n). You can print it vertically, you
> can print it horizontally, I don't care, it's just a list of numbers!"
>
> And now JD shows us how to confuse ourselves with row vectors and column
> vectors in IDL! As if HISTOGRAM wasn't enough. JD, I call down a curse on
> you, and your children, and your children's chil.....[falls from chair in
> paroxysm of rage]
Good on ya. I aim to please.
JD
P.S. The many ways to make column vectors:
IDL> cv=[[1],[2],[3]]
or
IDL> cv=rotate([1,2,3],1)
or
IDL> cv=transpose([1,2,3])
or
IDL> cv=array[0,*]
or
IDL> cv=reform([1,2,3],1,3)
or
IDL> cv=[1,2,3]##1
or
IDL> cv=1#[1,2,3]
or
...