Tr()

For questions that don't fall into one of the categories above, such as working with the RATS interface, using Wizards, etc.
ivory4
Posts: 144
Joined: Mon Aug 24, 2009 12:16 pm

Tr()

Unread post by ivory4 »

Code: Select all

com c = ||1.0,1.0,0.0||
disp tr(c)
disp c
why tr(c) and c look the same on out put? what is the dimension here?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Tr()

Unread post by TomDoan »

VECTOR's are officially column vectors (so it would be 3x1) for matrix multiplications, but will behave as row vectors in other situations if that appears more convenient. DISPLAY would be a good example. I doubt very many people would like to see a multiple line output for a 20 vector. Thus the ector is shown in a single row because that looks best, and tr(c) is shown in a row because it's a 1xn array. You can always use %rows and %cols to get the actual sizes as they would be used in matrix arithmetic.
Post Reply