Skip to main content
1-Visitor
November 17, 2021
Solved

Programming in Mathcad

  • November 17, 2021
  • 2 replies
  • 2210 views

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 

Best answer by 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

2 replies

ttokoro
21-Topaz I
21-Topaz I
November 18, 2021

image.pngimage.pngimage.png

t.t.
23-Emerald V
November 18, 2021

@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

 

1-Visitor
November 18, 2021

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?

 

23-Emerald V
November 18, 2021

@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