Page 1 of 1
Tr()
Posted: Wed Jul 21, 2010 12:35 pm
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?
Re: Tr()
Posted: Wed Jul 21, 2010 2:17 pm
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.