Skip to main content
1-Visitor
August 20, 2011
Solved

stacking range value of matrices

  • August 20, 2011
  • 6 replies
  • 3104 views

hello, I am new to mathcad programming. I am trying to create a program which has te following input: a function and matrix made of a variable number of rows and a column (a vector). The solution of the function for every element of the vector is a vector. I am trying to make a program which will stack the results for every value of the function, with the argument take from the vector.

To better understand what I am trying I attached the file.

Thank you.

Best answer by RichardJ

Do you mean this?

6 replies

RichardJ19-TanzaniteAnswer
19-Tanzanite
August 20, 2011

Do you mean this?

1-Visitor
August 20, 2011

An alternative to Richards proposal. Although my example has used the predefined function 'vec', no additional programming is required.

I have also changed the origin to zero.

Mike

1-Visitor
August 20, 2011

Sorry I bored tonight!!!!

Another example if you don't want to use the built in function vec - I have added an additional For Loop to your program.

Mike

1-Visitor
August 20, 2011

A word of caution, try not to defines variables as you have with h.i, a lot of programs are written using i and j in For loops, as you have, and it becomes very confusing.

Mike

1-Visitor
August 21, 2011

Thank you for your help. I know it is confusing to use h.i, but my working domain is that of civil engineering, and some notation use the indice i, sometimes it can't be avoided.

1-Visitor
August 21, 2011

I know it is confusing to use h.i, but my working domain is that of civil engineering, and some notation use the indice i, sometimes it can't be avoided.

There are many ways to get around it.

You used subscript i in your definition of h and then used i in the For Loop. Maybe change the For Loop variable name to something else.

Mike