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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Help with if loop with array

ptc-3679927
5-Regular Member

Help with if loop with array

There's no error in the worksheet, but the answer is incorrect. How do i define in Mathcad so that it would read each scalar in the array instead of a whole. 

(Mathcad 15)

1 ACCEPTED SOLUTION

Accepted Solutions

One way is as follows:

 

selection.JPG

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald III
(To:ptc-3679927)

Yes, no error message from mathcad. ..
And the answers are all correct...given the equations and formula.
BUT: what did you expect to get. What is your purpose?
Please explain.

Success!
Luc

One way is as follows:

 

selection.JPG

Turning the calculation into a function and calling that function vectorized might be an option.
Furthermore you have to use the logical "or" operator to connect your two conditions.

You don't have to name the formal function  argument "class_id" as I did, you may name it simply "class" as well.

Furthermore you may consider making "Dp" a second function argument.

Werner_E_0-1579547658903.png

MC15 worksheet attached

 

Top Tags