Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Sum up certain elements of a matrix

$
0
0
Sorry! I got lost writing the message. So, again, I'd like to transform:

A =
    0.6000 0.7000
    0.6000 0.7000
    0.6000 0.7000
    0.6000 555.0000
    0.6000 NaN
  555.0000 NaN
       NaN NaN

In B:

B=
    3 2
    2.5 1.5
    2 1
    1.5 0.5
    1 NaN
  0.5 NaN
       NaN NaN

But, my result is:

B=
0.6000 0.7000
    0.6000 0.7000
    0.6000 1.0000
    0.6000 0.5000
    1.0000 NaN
    0.5000 NaN
       NaN NaN

The matter here is that 555 is replaced and the element above is sumed correctly, but the operation stops. How can I get it for the entire column?

Thanks again!

Viewing all articles
Browse latest Browse all 19628

Trending Articles