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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

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

Ahmed
1-Visitor

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
MihaiMoraru
12-Amethyst
(To:Ahmed)

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
25-Diamond I
(To:Ahmed)

Which version of Mathcad are you using?

Ahmed
1-Visitor
(To:Werner_E)

Hi Werner Exinger

It's mathcad 14

Werner_E
25-Diamond I
(To:Ahmed)

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

add_mat.png

Ahmed
1-Visitor
(To:Werner_E)

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

Thanks a lot Werner

regs

Ahmed

Werner_E
25-Diamond I
(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.

Announcements

Top Tags