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

Translate the entire conversation x

Help with program

JH_9781973
8-Gravel

Help with program

Could someone please help me with what I am doing wrong here? 

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:ttokoro)

To JH_9781973..

You should also realise that:

1.

LucMeekes_0-1741167781485.png

contains the value 2.54, because index counting starts at 0 (controlled by the value of system variable ORIGIN).

2.

The test

LucMeekes_1-1741167873769.png

will always return False, because to test for NaN's you'd have to use the IsNan() function.

3. 

Your loop is a bit silly, becasue you are testing the same thing over and over again.

The reason the result of your program is 5 (after applying TTokoro san's correction) is because p=6, if you set p:=3, the result of your program will be 2, because the program defines keep := x -1, and x runs from 0 to p.

4.

The top left corner of the matrix System (at index 0,0), contains the string value "Size", which is not a number but it is also not a NaN.

(a NaN is a special number, defined within the IEEE number format)

 

Success!
Luc

 

 

View solution in original post

7 REPLIES 7

image.pngmust before image.png 

image.png must need value a.

LucMeekes
23-Emerald III
(To:ttokoro)

To JH_9781973..

You should also realise that:

1.

LucMeekes_0-1741167781485.png

contains the value 2.54, because index counting starts at 0 (controlled by the value of system variable ORIGIN).

2.

The test

LucMeekes_1-1741167873769.png

will always return False, because to test for NaN's you'd have to use the IsNan() function.

3. 

Your loop is a bit silly, becasue you are testing the same thing over and over again.

The reason the result of your program is 5 (after applying TTokoro san's correction) is because p=6, if you set p:=3, the result of your program will be 2, because the program defines keep := x -1, and x runs from 0 to p.

4.

The top left corner of the matrix System (at index 0,0), contains the string value "Size", which is not a number but it is also not a NaN.

(a NaN is a special number, defined within the IEEE number format)

 

Success!
Luc

 

 

Thank you for the detail I made the changes but still for some reason it does not work. How do I go to correct this? 

LucMeekes
23-Emerald III
(To:JH_9781973)

Show what you have now. (You should always attach the worksheet and state which version of Prime you are using, Well, in your case it's Prime 10. )

 

Success!
Luc

I am using Mathcad Prime 10.1 and attached the worksheet to my initial post should I re-attach again? 

LucMeekes
23-Emerald III
(To:JH_9781973)

You said you made changes, so yes.

 

Success!
Luc

Hello Luc,

 

[Edit] I got it  Thank you for help. 

Announcements

Top Tags