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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Create a function that add each line of a matrix to each line of another matrix

Ahmed
1-Newbie

Create a function that add each line of a matrix to each line of another matrix

Hi all,

Can anyone help me on this please?

I would like to create a function that add each line of a 12x6 matrix to each line of another 12x6 matrix and return a 144x6 matrix.

Thanks

Ahmed

7 REPLIES 7

Use the built-in stack keyword function... and you do not have to create your own function.

But since you want a 144x6 matrix (I think you would like to have a 24x6 matrix)... I think it will be better just to add your worksheet here... and to give more details.

Regards,

Mihai

Thanks MihaiMoraru but I left the worksheet at the office.

The resulting matrix Z I want should be:

If I go from X(12X6) and Y(12X6)

Z1st row = X1st row+Y1st row

Z2nd row = X1st row+Y2nd row

...

Z12th row = X1st row+Y12th row

Z13th row = X2st row+Y1st row

...

Z144th row = X12th row+Y12th row

Do you see ?

Ahmed

Werner_E
24-Ruby V
(To:Ahmed)

Which version of Mathcad are you using?

Ahmed
1-Newbie
(To:Werner_E)

Hi Werner Exinger

It's mathcad 14

Werner_E
24-Ruby V
(To:Ahmed)

Here is a quick solution for Mathcad 15 with rudimentary error handling and ORIGIN-aware

add_mat.png

Ahmed
1-Newbie
(To:Werner_E)

It does seem to be working, I will try this out tomorrow...

Thanks a lot Werner

regs

Ahmed

Werner_E
24-Ruby V
(To:Ahmed)

Ahmed Arbane wrote:

It does seem to be working, I will try this out tomorrow...

Thanks a lot Werner

regs

Ahmed

You are welcome.

You should be able to open the sheet with MC14 w/o problems. The question about the version was mainly Mathcad vs. Prime. Any of these can't open the file format of the other.

Top Tags