Matrix columns and how to equate them to vectors

Here's the problem:

Make/N=(10,3)/D a  // setting up a matrix 'a' with 10 rows and 3 columns<br />
Make/N=10/D b  // seting up a 10-row vector 'b'<br />
b={1,2,3,4,5,6,7,8,9,0} // set b values<br />
print b<br />
  b[0]= {1,2,3,4,5,6,7,8,9,0}<br />
a=0<br />
print a<br />
  a[0][0]= {0,0,0,0,0,0,0,0,0,0}<br />
a[0][1]= {0,0,0,0,0,0,0,0,0,0}<br />
a[0][2]= {0,0,0,0,0,0,0,0,0,0}<br />
a[][0]=b  // set first column of a to equal b<br />
print a  // which works as expected<br />
  a[0][0]= {1,2,3,4,5,6,7,8,9,0}<br />
a[0][1]= {0,0,0,0,0,0,0,0,0,0}<br />
a[0][2]= {0,0,0,0,0,0,0,0,0,0}<br />
<br />
a[][1]=b  // try to set the second column of a to equal b and...<br />
print a<br />
  a[0][0]= {1,2,3,4,5,6,7,8,9,0}<br />
a[0][1]= {0,0,0,0,0,0,0,0,0,0}<br />
a[0][2]= {0,0,0,0,0,0,0,0,0,0}<br />

What is happening and how do I equate random columns in a matrix to a 1-D vector with the same number of rows?

This is most puzzling. The Manual is immensely detailed but (maybe as a consequence) I cannot find an explanation on how Igor indexes arrays, which might explain what's happening.

DN
This kind of wave assignment is one of the most powerful things to learn about IGOR.

I think this is what you want to do.

a[][1] = b[p]


THere is something in the help file that describes this kind of wave assignment. Try typing:
DisplayHelpTopic "Multidimensional Wave Assignment"

in the command line.

BTW you can create a wave like this:
make/o/d b={1,2,3,4,5,6,7,8,9,0}

or you could try:
make/o/d/n=10 b
b[] = p //which won't do exactly the same thing.
Brilliant! Thanks. Works like a charm. I knew there had to be a simple and powerful way to do it - any application with a 2000+ page manual is going to have ways to do anything, but until you get to know the help system well, the trick is to know what to ask it.

andyfaff wrote:
This kind of wave assignment is one of the most powerful things to learn about IGOR.
I think this is what you want to do.
a[][1] = b[p]