Skip to main content
13-Aquamarine
May 6, 2023
Solved

Value must be a scalor or a matrix

  • May 6, 2023
  • 2 replies
  • 1134 views

I'm not really sure what is wrong with my document.   If I simply evaluate the function ZL() I get a vector output (or what I'd call a vector - matrix with one column).  When I take the same function and assign to a variable I get the error screen captured below.  

 

Is there a way to explicitly define a variable to be a vector or matrix?   Or, is that not the problem?  I've attached the Mathcad Prime document.

 

mathcad_must_be_a_scalar.jpg

 

 

EDIT:  Looks like the issue might be because I'm using a range variable (see link below).   So, how do I convert a range variable to a matrix/vector variable?

 

https://support.ptc.com/help/mathcad/r8.0/en/index.html#page/PTC_Mathcad_Help/range_variables.html

 

Best answer by ttokoro

You need a range to vector magic,image.png
after the definition of range Wt 

image.png

Then, you getimage.png

2 replies

ttokoro
21-Topaz I
ttokoro21-Topaz IAnswer
21-Topaz I
May 7, 2023

You need a range to vector magic,image.png
after the definition of range Wt 

image.png

Then, you getimage.png

t.t.
25-Diamond I
May 7, 2023

Yes, distinguishing between ranges and vectors is a constant stumbling block in Mathcad and Prime. The scope of using ranges is limited.

See the link below for a slightly more detailed explanation - including how to convert a range to a vector, as ttokoro also showed.

https://community.ptc.com/t5/Mathcad/Redefining-function-result-as-a-vector/m-p/872933/highlight/true#M206526