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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

MathCAD example not working corectly

Bogdan_d
8-Gravel

MathCAD example not working corectly

I am trying to do a example from the MathCAD example "Generating Random Numbers"

and it doesn't work properly. The norm function it doesn't show the proper plotting.

Also the other examples from the tutorial, are hard to be plotted: scalar representation versus array.

If you do a new version of software why there are no updates in the examples provided to reflect the version and changes in the software updates.

Nevertheless in the example are some mistakes in the variable names that I correct them.

It is something there, that I am doing wrong?

 

 

 

ACCEPTED SOLUTION

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

1) When you define the range "n", don't follow the definition with an inline evaluation but rather evaluate "n" in a separate region. Using the inline evaluation turns the range into a vector which can't be used as a matrix/vector index (see below)

Werner_E_0-1681215318333.png

2) Prime offers two subscripts/indices and you used the wrong one throughout. You used the literal subscript which you als get using "Ctrl -" which is just part of a variable name. Thats also the reason you could not simply use "x" of "F" as in the example because you got the error message that the variable is not defined.
You have to use the vector/matrix index instead. Doing so defines vectors "x", "F", etc. and not simple scalars.

Werner_E_1-1681215603640.png

 

3) You had a typo when you defined "int". You wrote "n" instead of "w".

Werner_E_2-1681215706738.png

Once these errors are corrected you get the desired result as in the help pages.

Werner_E_3-1681215772717.png

Corrected sheet in Prime 9 format attached

 

View solution in original post

2 REPLIES 2
Werner_E
25-Diamond I
(To:Bogdan_d)

1) When you define the range "n", don't follow the definition with an inline evaluation but rather evaluate "n" in a separate region. Using the inline evaluation turns the range into a vector which can't be used as a matrix/vector index (see below)

Werner_E_0-1681215318333.png

2) Prime offers two subscripts/indices and you used the wrong one throughout. You used the literal subscript which you als get using "Ctrl -" which is just part of a variable name. Thats also the reason you could not simply use "x" of "F" as in the example because you got the error message that the variable is not defined.
You have to use the vector/matrix index instead. Doing so defines vectors "x", "F", etc. and not simple scalars.

Werner_E_1-1681215603640.png

 

3) You had a typo when you defined "int". You wrote "n" instead of "w".

Werner_E_2-1681215706738.png

Once these errors are corrected you get the desired result as in the help pages.

Werner_E_3-1681215772717.png

Corrected sheet in Prime 9 format attached

 

Hi Werner_E,

Thank you a lot for your quick reply and explanation.

Now is working.

Announcements

Top Tags