Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
In the attached Mathcad Prime worksheet I am attempting to create variables L sub 1 through 4 where each value of L start at 5ft and adds a distance to it based on it's array value of L. This seems trivial, what am I missing in the attached?
Solved! Go to Solution.
Don't use inline evaluation after defining the range variable i. Delete the = after definition and if you want to see what you have created, use i=... in a separate region.
Using the inline eval as you did converts the range i into a vector and you can't use vector elements to index another vector L. Its an undocumented dirty trick to quickly turn a range into a vector.
Don't use inline evaluation after defining the range variable i. Delete the = after definition and if you want to see what you have created, use i=... in a separate region.
Using the inline eval as you did converts the range i into a vector and you can't use vector elements to index another vector L. Its an undocumented dirty trick to quickly turn a range into a vector.
Thank You Werner, is there a way to turn a vector back into a range variable (not that I have an example where I would want to do this, just curious).
Daniel Sochor wrote:
Thank You Werner, is there a way to turn a vector back into a range variable (not that I have an example where I would want to do this, just curious).
No and this would not make much sense as the values of a range are equally spaced while the elements of a vector could be anything you like. So conversion would have to fail most of the times.
But it sure is very easy to write a very small function to convert a vector to a range by just using the first, second and last element of that vector:
It sure is a design error that ranges and vectors look perfectly alike in Prime. This can be very confusing,