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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Programming in Mathcad

JR_10083483
3-Newcomer

Programming in Mathcad

Hello Experts,

 

I am pretty new to mathcad and unable to understand what I am missing in program I have written. 

 

Any help is appreciated 

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:StuartBruff)


@StuartBruff wrote:

@JR_10083483 wrote:

Thank you for the quick suggestion and detailed explanation 

 

I was looking for output as below 

JR_10083483_0-1637267164104.png

Is it possible to have it in Mathcad?


There are other ways, using matrix operations or user-defined functions to, say, replicate a vector.


Oh well, I guess my cup of tea can wait a few minutes ...

 

2021 11 18 G.png

 

Stuart

View solution in original post

5 REPLIES 5
ttokoro
20-Turquoise
(To:JR_10083483)

image.pngimage.pngimage.png

StuartBruff
23-Emerald III
(To:JR_10083483)


@JR_10083483 wrote:

Hello Experts,

 

I am pretty new to mathcad and unable to understand what I am missing in program I have written. 

 

Any help is appreciated 


There's rather a lot to unpack for such a short program, so I've put my comments in the attached worksheet.  Don't worry, Mathcad's differences from most programming languages mean that things such as array indexing and implicit multiplication cause confusion initially, but people soon get used to it.

 

Stuart


Edited to add:

 

2021 11 18 A.png

 

2021 11 18 B.png

 

2021 11 18 C.png

 

2021 11 18 D.png

 

Thank you for the quick suggestion and detailed explanation 

 

I was looking for output as below 

JR_10083483_0-1637267164104.png

Is it possible to have it in Mathcad?

 

StuartBruff
23-Emerald III
(To:JR_10083483)


@JR_10083483 wrote:

Thank you for the quick suggestion and detailed explanation 

 

I was looking for output as below 

JR_10083483_0-1637267164104.png

Is it possible to have it in Mathcad?


Almost.  There are several ways to create the array of values, but I don't think you can display the numbers like that (right justified, trailing zeros except for zero itself) without using a component (eg, Excel).

 

As for the values, not sure if the programs work because I only have Mathcad Express, but ..

 

2021 11 18 E.png

 

And here's one with a larger set of values

 

2021 11 18 F.png

 

There are other ways, using matrix operations or user-defined functions to, say, replicate a vector.

 

Stuart

StuartBruff
23-Emerald III
(To:StuartBruff)


@StuartBruff wrote:

@JR_10083483 wrote:

Thank you for the quick suggestion and detailed explanation 

 

I was looking for output as below 

JR_10083483_0-1637267164104.png

Is it possible to have it in Mathcad?


There are other ways, using matrix operations or user-defined functions to, say, replicate a vector.


Oh well, I guess my cup of tea can wait a few minutes ...

 

2021 11 18 G.png

 

Stuart

Announcements

Top Tags