Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Mathcad prime 8 is having trouble understanding Vector quantity. When I open the worksheet, It automatically calculates and throws the error " This value must be scalar or vector".
When the equals sign is deleted and replaced, the worksheet works fine.
But then if I change the units from "m" to "mm", the worksheet looses the vector values again and throws the same error. Can someone confirm if there is permanent solution to this.
P.S: I created this worksheet in Mathcad prime 7.0, recently got prime 8 installed. Could that be reason? Or just this version has the bug.
Solved! Go to Solution.
In Prime 8 you can create a range with units:
It will display as a range (which is not discernable from the display of a vector):
And you can change the unit, from m to mm:
But it stays a range, you cannot index it:
When you define a range and immediately evaluate the definition, you get a vector:
(You can index it:
)
BUT, if you change the result unit, (e.g. from m to mm), you get:
With error: "This value must be a scalar or a matrix", and then of course the variable is undefined:
let alone that you can index it.
To repair, you have to remove the evaluation from the range definition, so remove the =.
After that you can (if you want) re-add the evaluation the arrive (again) at:
It appears that Prime 7 is immune to changing the unit of the evaluation of the definition of a range with units:
Defining a vector through immediate evaluation of a range definition is an undocumented feature/bug. It should not be used, or else with extreme care and realising that this feature/bug can be broken/fixed at any Prime revision.
Success!
Luc
Delete = after the definition of function. Then You can do what you want.
I can confirm that what you tried works OK in Prime 6.
So obviously they broke something in Prime 8.
But you must be aware that the convenient feature of turning a range into a vector by following the definition immediately by an evaluation always has been an undocumented feature and as such always was a candidate subject to be changed without notice. I guess that for some reason they broke that feature at least when using it with units.
I guess that, even though you cannot change the unit from m to mm in the evaluation after the definition you may be able to do so in a separate region as the conversion from a range into a vector still seems to work (can't test myself as of lack of P8):
The "normal"/"official" ways to create a vector should not been affected, too, I suppose. For instance
In Prime 8 you can create a range with units:
It will display as a range (which is not discernable from the display of a vector):
And you can change the unit, from m to mm:
But it stays a range, you cannot index it:
When you define a range and immediately evaluate the definition, you get a vector:
(You can index it:
)
BUT, if you change the result unit, (e.g. from m to mm), you get:
With error: "This value must be a scalar or a matrix", and then of course the variable is undefined:
let alone that you can index it.
To repair, you have to remove the evaluation from the range definition, so remove the =.
After that you can (if you want) re-add the evaluation the arrive (again) at:
It appears that Prime 7 is immune to changing the unit of the evaluation of the definition of a range with units:
Defining a vector through immediate evaluation of a range definition is an undocumented feature/bug. It should not be used, or else with extreme care and realising that this feature/bug can be broken/fixed at any Prime revision.
Success!
Luc
Yeah I Agree, with your approach. That is what I have been doing to avoid the error. AS you said maybe prime 7 is immune to such kind of error, I would have expected the newer version to be immune too. Seems like its going backwards in development. If it is bug, is there a place to report bugs as such directly to PTC MathCAD?
Thanks
It probably can't be called a bug as it concerns an undocumented feature.
The only way to officially report a bug is to open a support call/ticket.