Solved
Vector oddity
- August 27, 2014
- 1 reply
- 2098 views
Hi,
Please can someone tell me why the second vector (V2) is different to the first (V1) in the attached workbook.
Version: Mathcad 15.0
I don't know what you mean by "changing the right hand side without actually changing it". Either it is changed, or it isn't.
For the first vector you use the range variable a to index the vector. When a=1, it assigns that value to element 1 of the vector. When a=2, it assigns that value to element 2 of the vector. Etc.
For the second vector you also use the range variable a to index the vector, but now you are assigning the value of b to whatever element a indexes. So when a=1 it assigns the range variable b to element 1 of the vector. When a=2 it also assigns the range variable b to element 2 of the vector. Etc. Since each element of the vector is a range it displays them as NaN (not a number). If you evaluate v[1, you will see that you get a range. You can also select the displayed vector, go to "format", "results", and on the "Display options" tab check the box "expand nested arrays", and select "matrix" as the display style.
Incidentally, but very importantly, note that arrays in Mathcad start at index 0 by default, not 1.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.