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

stacking range value of matrices

BogdanLeonte
1-Newbie

stacking range value of matrices

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Do you mean this?

View solution in original post

6 REPLIES 6

Do you mean this?

MikeArmstrong
5-Regular Member
(To:BogdanLeonte)

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

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

MikeArmstrong
5-Regular Member
(To:BogdanLeonte)

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

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.

MikeArmstrong
5-Regular Member
(To:BogdanLeonte)

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

Top Tags