Skip to main content
4-Participant
March 23, 2020
Solved

Add matrix columns as vector

  • March 23, 2020
  • 2 replies
  • 2662 views

I've got a matrix with i rows and j columns.  I'd like to add all i scalars in column 0 as the 0th element in a new j-element vector, and add all i scalars in column 1 as the 1th element etc..

How?  The column operator seems to require an integer, not a range variable to select the column.

 

Best answer by Werner_E

Its a long time ago I had MC14 installed but I am not aware of any difference in this respect.
Its strange as you wrote that the very same approach worked OK when you retyped it.

Anyway, you have some solutions now you can chose from.

2 replies

23-Emerald IV
March 23, 2020

Like this...

LucMeekes_0-1584987782469.png

Success!
Luc

4-Participant
March 23, 2020

Hi, Luc,

I wrote that into my MathCAD 14, but it doesn't work, attached.  The column operator is flagged as an error, "this value must be an integer."

Any ideas?  Is it time for me to upgrade my version?

...Larry

25-Diamond I
March 23, 2020

Here is an approach without any ranges:

Werner_E_0-1584992129538.png

 

> Any ideas? Is it time for me to upgrade my version?

No, Luc is using good old Mathcad 11. I just opened his file and it works OK in Mathcad 15, so it should do so as well in MC14. You just have to manually recalculate the sheet because Luc turns off autocalc by default, but you should not get any error message.

Did you used Lucs attached file or did you retype what he did?

 

4-Participant
March 23, 2020

Hi, Werner,

I tried Luc's file directly, no joy, although autocalc was on. Nothing worked, even the simple range variables were not defined. I then typed it in, now everything works except the final summation. Something wrong with the column operator not accepting a vector in MC14? Your programmed solution does work (:<))

Thanks for your help...

...Larry

 

Werner_E25-Diamond IAnswer
25-Diamond I
March 23, 2020

Its a long time ago I had MC14 installed but I am not aware of any difference in this respect.
Its strange as you wrote that the very same approach worked OK when you retyped it.

Anyway, you have some solutions now you can chose from.