Greetings,

I have a 48x88 matrix and I need to sum the 1st element to the 23rd, the 2nd element to the 24th, etc until the 66th to the 88th (always using a 22 interval).
Then I have to divide 100 by the sum of each column. The result will be multiplied by each element of that same column.

What is the most effective way to do this? Nested for functions?
This is not an undergraduate college question.

Thank you for your replies. I appreciate them.

Recommended Answers

All 3 Replies

Just write some code that does the algorithm you want, there's no "effective" solution.

I'm sure there's some matrix slicing functions you could use; Matlab does those faster than its interpreted language.

Thank you, I wish you a great new year.

It sounds like you really have a 3-D array that should be 48x4x22. Is this the case?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.