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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Add matrix columns as vector

LarryBaxter
4-Participant

Add matrix columns as vector

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.

 

ACCEPTED SOLUTION

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

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.

View solution in original post

5 REPLIES 5
LucMeekes
23-Emerald III
(To:LarryBaxter)

Like this...

LucMeekes_0-1584987782469.png

Success!
Luc

LarryBaxter
4-Participant
(To:LucMeekes)

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

Werner_E
25-Diamond I
(To:LarryBaxter)

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?

 

LarryBaxter
4-Participant
(To:Werner_E)

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

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.

Announcements

Top Tags