Skip to main content
6-Contributor
September 11, 2023
Question

This value must be a scalar

  • September 11, 2023
  • 1 reply
  • 2067 views

I am getting error this value must be a scalar what is wrong with the worksheet. 

1 reply

25-Diamond I
September 11, 2023

Are you really expecting h.n to be a 3 x 3 matrix with a total of 9 values?

 

I guess you just want it to be a 3 x 1 matrix( vector), correct?

 

So you should do it that way (no need for the range j):

Werner_E_0-1694466534676.png

For the subsequent calculations I would not use the range variable(s) but rather use the vectors as function arguments and use vectorization (the arrow over the expression):

Werner_E_1-1694466641161.png

Modified Prime 9 sheet attached

 

 

25-Diamond I
September 11, 2023

After looking closer in your sheet I guess now, that you actually wanted hn to be a 3x3 matrix, covering all combinations of the three TQ values and the three LCp percentages.

To make it work you have to name the guess value differently from the result matrix, e.g.

Werner_E_2-1694467485660.png

Don't display the matrix using the ranges i, and j as it will look like a vector if you do so

Werner_E_3-1694467531525.png

Similar for the other subsequent calculations

Instead of displaying

Werner_E_4-1694467640177.png

you may rather assign the function result to a variable and display it

Werner_E_5-1694467699788.png

 

 

6-Contributor
September 12, 2023

Thank you Werner for the help. In here why  it is necessary to have hhn instead of hn also, the result output hnij how do I get 1 4 and 7 value as 1 2 and 3 value the hierarchy is mismatching any suggestions