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!

Does anyone know how to fix this....

Status
Not open for further replies.

Diquan

Civil/Environmental
Dec 30, 2002
90
I don't understand that "must be an scalar", the number is already an scalar!

mustbescalar4ea.jpg
 
Replies continue below

Recommended for you

Hello,

your second variable "rho" is a matrix with the dimension 1x1 and no skalar (because it stands in brackets).

The easiest way to fix this, is to define a new variable like this: p = r[0,0

That extractes the 0,0-element from this matrix and writes it to a scalar variable.

That would work but I think, your mistake is in the calculation before, rho shouldn't be a 1x1-matrix. This occurs if you multiple a 3x1 with a 1x3 matrix as vectorproduct. Instead of this you can use the scalarproduct (3x1)^T * (1x3). But there may be other possibilities.

Sorry for bad spelling, I've only spare time.
Christian
 
I also tried to fix it with the solution that you gave me, but i don't understand it, is:

p = r[0,0

Now, i tried to write that but nothing happend, gave me an error, can you take a picture of that, like an example or something?

Thanks!
 
Your problem starts with the definition of d, since its result shows up with a parenthesis around a single number, indicating a 1-D vector.

The simplest solution is to select the end of the definition of d and tack on [0. Since the vector is 1-D, [0,0 results in an error.

TTFN
 
The problem is that the vlookup function returns a vector.

From Mathcad Help:
vlookup(z, A, c) Looks in the first column of a matrix, A, for a given value, z, and returns the value(s) in the same row(s) in the column specified, c. When multiple values are returned, they appear in a vector.
Apparently when a single value is returned, it appears in a one row vector.

IRstuff's solution should work.
 
HEY!!, that's perfect!!!, worked BEAUTIFUL!!!

Thanks very much!!!

here it is........

solution3px.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor