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

Help with if loop with array

SOLVED
Highlighted
Participant

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

Re: Help with if loop with array

One way is as follows:

 

selection.JPG

View solution in original post

3 REPLIES 3

Re: Help with if loop with array

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

Re: Help with if loop with array

One way is as follows:

 

selection.JPG

View solution in original post

Re: Help with if loop with array

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

 

Announcements