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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

element-wise vector addition

jsuarez
1-Visitor

element-wise vector addition

WE & Fred thank you very much for answering the question, specially to WE.

WE, is it possible to get the answer in the following format? Thank you

Header 1Header 2Header 3
ab
AA+aA+b
BB+aB+b
CC+aC+b

Original question

Hi, is it possible in Mathcad 15 or Prime to do a vector element by element addition that takes as input 2 vectors for example,vector x = [ A,B,C ] and y = [ a,b ] and has as output z = A+a, A+b, B+a, B+b,C+a & C+b ?

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:jsuarez)

Had not seen your previous reply.

Here you are:

View solution in original post

4 REPLIES 4
Werner_E
25-Diamond I
(To:jsuarez)

Not being a spreadsheet, Mathcad is not really good in making nicely formatted tables with headers..

Does the attached help?

Hi Wegner,

Your are really and expert in programming in Mathcad. Can you address please the final question in my first post. This is  what I wrote back then in my first post

Hi WE, thank you very much for your excellent answer. Since you are asking me I  prefer if the 3X2 matrix would be 3  1x2 matrix,

[A+a, A+b]

[B+a, B+b]

[C+a, C+b]

Your previous two solutions are elegant, but I basically prefer the output as 3 separated matrices as shown above.

Thank you very much.

juan

Werner_E
25-Diamond I
(To:jsuarez)

Had not seen your previous reply.

Here you are:

Awesome Wegner!  thank you.

Announcements

Top Tags