...[Top posting repaired -- don't; hard follow conversation makes]...
> "Steven_Lord" <email@example.com> wrote in message > <firstname.lastname@example.org>... >> >> >> "Debela " <email@example.com> wrote in message >> news:firstname.lastname@example.org... >> > Hi all, >> > I have a problem on analysis of big matrix data, it is 1600x3000. >> What I > wanted to do is to select the maximum value of each raw and >> save it. For > example, x=data(3,:); max(x); can give me the maximum >> value of 3rd raw > out of 1600 but I want for all of them I tried a >> for loop and it is not > really successful. Any help would be >> appreciated. >> > Debela >> >> Use the DIM input to the MAX function. >> >> x = magic(7); >> maxDownColumns = max(x, , 1) >> maxAcrossRows = max(x, , 2) ...
> Thanks a lot. I still have some issues though. I wanted to find the > maximum and corresponding index (Which I can find now), but I want also > another value. For example if my maximum value is x, I want to find the > index of 0.8 *x and 0.002*x. The closest I came across is I multiplied > the maximum values by 0.8 and 0.002. Is there anyway I can find > something out of it. I have done in the past using for loop, the data > size was smaller though. Thanks.
Same idea, just
ix=find(x==0.8*xmax); % for example
NB: the above is subject to floating point roundoff; use
ix=find(abs(x-0.8*xmax)<1E-6); % or similar w/ a suitable error