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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Translate the entire conversation x

Variable IF function in matrix loop

AB_12612298
2-Explorer

Variable IF function in matrix loop

I'm using MathCAD Prime 10.0.1.0 and having difficulty having a function complete a different formula depending on if a previous variable is either "Yes", "No" or "Blank". 

 

The loop is meant to repeatedly calculate "b" and then determine if "b" is either a "yes" or "no", I added a blank option to allow the calculation to be skipped in a larger document if that section is left blank. However, it is just always registering the "b" variable as "blank".

The answers need to be provided in a matrices format.

 

AB_12612298_0-1734429764334.png

 

ACCEPTED SOLUTION

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

Are you looking for something like the attached?

 

Some notes:

When you choose Matrix^<1> using the column selector, you get the column, not the element. In your case you would get a 1x1 matrix containing the string "Yes" or "No" and NOT the string itself.

Werner_E_0-1734445374563.png

 

You had a typo, as Prime would consider "no" and " No" as different strings.

View solution in original post

1 REPLY 1
Werner_E
25-Diamond I
(To:AB_12612298)

Are you looking for something like the attached?

 

Some notes:

When you choose Matrix^<1> using the column selector, you get the column, not the element. In your case you would get a 1x1 matrix containing the string "Yes" or "No" and NOT the string itself.

Werner_E_0-1734445374563.png

 

You had a typo, as Prime would consider "no" and " No" as different strings.

Announcements

Top Tags