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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Writing a FOR program to solve a rangeof numbers and it only solves one of them.

BW_12688021
2-Explorer

Writing a FOR program to solve a rangeof numbers and it only solves one of them.

We had a formula written in Mathcad 15 that solved a range of numbers and gave a solution of the entire range (see image below). When we convert to Mathcad Prime 9.0 only the last number of the range gets solved (second image). We are looking for a maximum throughout the range so this does not help us very much. Is there a way to write the function in Mathcad Prime 9.0 to give similar results to Mathcad 15? Both files are attached.

BW_12688021_0-1735833945707.png

BW_12688021_1-1735833967333.png

 

1 REPLY 1
LucMeekes
23-Emerald III
(To:BW_12688021)

The result of a  Mathcad program is the result of the last statement executed, In your case that's the assignment to qSFI5. from one of the two IF branches.

It's really bad that Mathcad 15 apparently behaves differently in this respect.

To correct:

Make sure your program ends with a return statement. You can find 'return' on the programming pallette.

It should end up looking like this:

LucMeekes_0-1735841677184.png

Success!
Luc

Announcements

Top Tags