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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Excel Input - This value must be scalar or matrix

davidlimtw
7-Bedrock

Excel Input - This value must be scalar or matrix

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?

 

davidlimtw_0-1720900925812.png

 

3 REPLIES 3
LucMeekes
23-Emerald III
(To:davidlimtw)

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:
Werner_E_0-1720909292396.png

Its fine and OK to use your range "a" for plotting

Werner_E_1-1720909435042.png

 

For other things you rather should create and work with true vectors as shown and explained below:

Werner_E_2-1720910582875.png

 

Prime 10 sheet attached

 

Top Tags