Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

range variable won't work: "must be a scalar or matrix

Status
Not open for further replies.

jiminhan

Mechanical
Dec 22, 2012
1
i] is the variable, however when put in an equation, mathcad says "this value must be scalar or a matrix"

I have followed the steps on the PTC tutorial website videos but still no luck despite doing exactly what they're doing.

Attached is a screenshot. Please help!

Thanks

 
Replies continue below

Recommended for you

Unfortunately, it is often difficult to diagnose a Mathcad problem form just a screenshot; posting your worksheet is usually better (together with a screenshot showing your problem - it may work on somebody else's machine!).

There can be quite marked functional differences between objects that look typographically identical. What I think you have done is use the subscript button to enter i on the left hand side of the definition. What you should have used is the matrix index operator ... typing 'x' then '[' then 'i' should give you the result you want. The subscript button allows you to create a name with a subscripted part, such as xinit meaning, say, the scalar variable holding the initial value of x rather than a vector element with index init
 
Why do you type x[i= to get an answer? it should be x= or e.g. x[5=
 
Occupant,

you are right in that x= would be the simplest form to show x's value. However, xi is a valid form and may be useful when one only wants to display, say, the first 5 values (i:=0..4) or every other value (i:=0,2..last(x)).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor