cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

## How to convert a row of Excel cell values to a useful MCP vector?  6-Contributor

## How to convert a row of Excel cell values to a useful MCP vector?

Sorry if I am being a bit dense with this...

I created a table of values in the MCP 3 Excel component.

In the Outputs area, I set a variable ("Load") equal to a row of cells using an Output Expression multiplied by a unit (MW).

Outside of the Excel component, I evaluate Load and I get, for example, the following:

Load = [5.2 3.2 3.2 3.2 3.9] MW

One, when I looked at some YouTube tutoriials for the Excel component in which something very similar was done, the result of the evaluation was a vertical column of numbers rather than the horizontal row I get. Why is my evaluated result horizontal when the tutorial result is vertical?

Second, what is this variable in MCP terms? Is it a vector or a range variable?

Third, how do I use my variable. For example, if I wanted to set a variable, say, Load_3 to be equal to the 5th value in my vector (3.9), what would the syntax be? "x=Load(4)" does not work since my variable does not seem to be a vector or matrix (is it a range variable?)

Fourth, can I convert my Load variable to actually be a vector so I can use it in calculations?

Finally, if there are any tutorials or examples available for this area, please direct me to them.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions  23-Emerald I
(To:ddenholm)

I suspect that you defined a row of EXCEL as an input, so Mathcad declared a row array.

2 REPLIES 2  23-Emerald I
(To:ddenholm)

I suspect that you defined a row of EXCEL as an input, so Mathcad declared a row array.  6-Contributor
(To:Fred_Kohlhepp)

I am a little bemused as to why a column of 5 excel cells is a vector but a row of 5 excel cells is an array but in MCP that is obviously the case (once you pointed it out to me. ) 