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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Programming in Mathcad

JR_10083483
3-Visitor

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 

1 ACCEPTED SOLUTION

Accepted Solutions


@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


@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?

 


@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 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

Top Tags