Matrix

Reply
Contributor
Posts: 31

Matrix

hello all;

How can i convert the vector { 1  2  3} to {3  2  1}?

thanks

SAS Super FREQ
Posts: 3,755

Re: Matrix

Posted in reply to RaniaMamdouh

What have you tried?  To get started, read about subscripts in the doc: SAS/IML(R) 13.1 User's Guide .

In particular, study the example that uses the colon operator (Smiley Happy to form indices and to extract a subset of a matrix or vector: After you understand the example, use the fact that you can create an vector in reverse order like this: 3:1.  Investigate what happens if you use 3:1 as an index into your vector.

Ask a Question
Discussion stats
  • 1 reply
  • 145 views
  • 0 likes
  • 2 in conversation