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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

I get an error message in mathcad function (programming)

richardm55
7-Bedrock

I get an error message in mathcad function (programming)

I have created function in mathcad 15 and I get an error message. I have checked all arguments, non of them is matrix or vector, just variable with single number.

Maybe I am not allowed to define the same variable in the same function as I have done with Ie2_hs?

 

Thank you in advance for any help and advice. I will attach mathcad file next time if needed.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:richardm55)

Luc already mentione R1_hs as a row vector.

I.oad1 is such a vector, too as seems to be V.PSU1.

I guess that you are aware that these variable are vector (obviously indicating some tolerance) and you thought that by chosing the column number 1 of these vector would give you the center element. But what you get by doing so is a 1x1 vector/matrix, hence the error message.

 

Replace all occurrences of    variable^<1>   (column selector) by      variable[0,1    (matrix element select via indices) and the error should go away.

View solution in original post

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

I.loadi is a matrix, one row, three columns, but it's a matrix.

In the program you pick one column of this matrix. This gives you a vector, one element, but it's a vector.

Hence the complaint.

 

Success!
Luc

Werner_E
25-Diamond I
(To:richardm55)

Luc already mentione R1_hs as a row vector.

I.oad1 is such a vector, too as seems to be V.PSU1.

I guess that you are aware that these variable are vector (obviously indicating some tolerance) and you thought that by chosing the column number 1 of these vector would give you the center element. But what you get by doing so is a 1x1 vector/matrix, hence the error message.

 

Replace all occurrences of    variable^<1>   (column selector) by      variable[0,1    (matrix element select via indices) and the error should go away.

Thank you very much for your help. It works now.

Yes, you are right I thought with ^ I can select element in the one row  matrix and I did not realize that for element selection I should use matrix indices.

Announcements

Top Tags