Skip to main content
1-Visitor
February 24, 2017
Solved

element-wise vector addition

  • February 24, 2017
  • 1 reply
  • 2619 views

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 ?

Best answer by Werner_E

Had not seen your previous reply.

Here you are:

1 reply

25-Diamond I
February 27, 2017

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

Does the attached help?

jsuarez1-VisitorAuthor
1-Visitor
February 27, 2017

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_E25-Diamond IAnswer
25-Diamond I
February 28, 2017

Had not seen your previous reply.

Here you are: