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

symbolic for (each) loop error

StuartBruff
23-Emerald III

symbolic for (each) loop error

Using the for programming expression in "for each" mode is a useful mode when iterating over an array and the index of an element is not a concern.  The mode works under the numeric processor when used in a free-standing program and inside a function.

However, when using the symbolic processor, the mode only works in a free-standing program and not in a function (where it is much more useful).

This is a long standing error in Mathcad.  Has it been fixed in Prime?  Can it be fixed in the next Mathcad 15 update?

Stuart

ACCEPTED SOLUTION

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

It doesn't even work if the matrix is freshly defined inside the program

And, no - the bug wasn't fixed in Prime, at least not in Prime 3.0

Obviously a for-loop is interpreted/implemented differently in the symbolics and insist on a sequence like first value, (optional second. value) and end value.

Did the symbolic eval work in MC11 with Maple?

Werner

View solution in original post

5 REPLIES 5
Werner_E
25-Diamond I
(To:StuartBruff)

It doesn't even work if the matrix is freshly defined inside the program

And, no - the bug wasn't fixed in Prime, at least not in Prime 3.0

Obviously a for-loop is interpreted/implemented differently in the symbolics and insist on a sequence like first value, (optional second. value) and end value.

Did the symbolic eval work in MC11 with Maple?

Werner

Werner_E
25-Diamond I
(To:Werner_E)

Now I am further puzzled:

Mathcad 15 M030:

Prime 3.0

Prime was set to "English" using "/culture:en-US" but the error message still is in German. Something like "Object reference not set to an object instance".


Werner

StuartBruff
23-Emerald III
(To:Werner_E)

Werner Exinger wrote:

It doesn't even work if the matrix is freshly defined inside the program

No, it doesn't ... I forgot to add that as an example.

And, no - the bug wasn't fixed in Prime, at least not in Prime 3.0

Thanks.  I didn't think it would be, but (being Primeless for at least the next few months) I thought I'd check.

Obviously a for-loop is interpreted/implemented differently in the symbolics and insist on a sequence like first value, (optional second. value) and end value.

But only inside a function; not even defining the function as a local function works.  It seems happy enough when run as a worksheet-level program, though.

Did the symbolic eval work in MC11 with Maple?

I can't remember that far back! 

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

> But only inside a function

Its not the function itself but the combination of using a variable for the matrix in side a function. As shown above it works OK if the matrix is placed directly in the for loop.

Hi Stuart.

Following example let's me think that the bug it is related with the procedence of the argument as a global variable.

Best regards.

Alvaro.

Flat.gif

Announcements

Top Tags