Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi All,
why mathcad prime dont allow to input the results of a fuction with a range of input into the excel component. What is the way to go around this?
Solved! Go to Solution.
There is a huge difference between ranges (like your "a") and vectors). Unfortunately they look the very same in Prime when displayed.
Your problem stems from an "illegal" use of a range variable.
Ranges should be used to
1) index the elements of vectors and matrices
2) make for-loops in programs
3) define the abscissa values in a 2D-plot
but not for anything else.
Actually a range is not a data type consisting of a couple of values like a vector but rather kind of an implicit loop.
What you created when you typed f(a)= looks pretty much like an ordinary vector, but actually its not a vector and its also not a range - its an invalid object. You can't even assign it to a variable - you get an error if you try so:
Its fine and OK to use your range "a" for plotting
For other things you rather should create and work with true vectors as shown and explained below:
Prime 10 sheet attached
1. The output to Excel accepts only arrays, yours is a range.
2. The output to Excel accepts only unit less data, yours has a length dimension.
Success!
Luc
@LucMeekes wrote:
1. The output to Excel accepts only arrays, yours is a range.
2. The output to Excel accepts only unit less data, yours has a length dimension.
Actually "a" IS a range and "a" is NOT unit less, but still "a" IS accepted by the Excel component as input! 🙂
The problem is f(a), which neither is a range nor an array/vector.
There is a huge difference between ranges (like your "a") and vectors). Unfortunately they look the very same in Prime when displayed.
Your problem stems from an "illegal" use of a range variable.
Ranges should be used to
1) index the elements of vectors and matrices
2) make for-loops in programs
3) define the abscissa values in a 2D-plot
but not for anything else.
Actually a range is not a data type consisting of a couple of values like a vector but rather kind of an implicit loop.
What you created when you typed f(a)= looks pretty much like an ordinary vector, but actually its not a vector and its also not a range - its an invalid object. You can't even assign it to a variable - you get an error if you try so:
Its fine and OK to use your range "a" for plotting
For other things you rather should create and work with true vectors as shown and explained below:
Prime 10 sheet attached
Hello @davidlimtw,
It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Vivek N.
Community Moderation Team.