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

Exploring Mathcad Programming (to do with units)

RWickrama
5-Regular Member

Exploring Mathcad Programming (to do with units)

I need to get around the part of following programming where I need the variable to assign units (seconds in this example). It is not going through.

I request someone help me:  Thanks a lot

IMAGE-0002.png

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald I
(To:RWickrama)

You may consider using this to create your array:

LucMeekes_0-1587590681305.png

Result:

LucMeekes_1-1587590702674.png

Success!

Luc

View solution in original post

5 REPLIES 5
RWickrama
5-Regular Member
(To:RWickrama)

IMAGE-0002_2.png

LucMeekes
23-Emerald I
(To:RWickrama)

The element of xx with index 2 never gets a value, so when i=3, an error occurs when trying to access that element.

 

Success!
Luc

LucMeekes
23-Emerald I
(To:RWickrama)

You cannot attach units to a variable that you use to index (point at) elements of an array.

If you want the array elements to have units, attach the unit to the elements, or attach the unit to the array at once in the return statement.


Success!
Luc

LucMeekes
23-Emerald I
(To:RWickrama)

You may consider using this to create your array:

LucMeekes_0-1587590681305.png

Result:

LucMeekes_1-1587590702674.png

Success!

Luc

View solution in original post

RWickrama
5-Regular Member
(To:LucMeekes)

Thanks. It is a help to improve my skills. I also got round s follows.

RWickrama_0-1587599111789.png

 

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."