how to make cell2mat for many column to one vector ?
Ältere Kommentare anzeigen
i have a cell like this image

i want to get the maximum value from valeu of column 2 to 5. when i using cell2mat function, i get the error. so, how to convert the value of column 2 to 5 to be vector so i can get the maximum value ? thanks
3 Kommentare
You show us the contents of "data" and a variable "a.nilai". The error message means, that "a.nilai{2,1}" is not a cell. But how could we know which variable you want to process? And what do you assume to be the "maximum" of a list of complex values?
ElizabethR
am 24 Apr. 2016
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 24 Apr. 2016
Did you try something like this
col5 = nilai{:, 5};
magCol5 = abs(col5);
[maxValue, indexOfMax] = max(magCol5)
5 Kommentare
ElizabethR
am 24 Apr. 2016
Image Analyst
am 24 Apr. 2016
You just don't have enough deciaml places to see that it's slightly different. Try
format long g
and then look and you'll see it's slightly longer than the real-only part of the number.
ElizabethR
am 25 Apr. 2016
Image Analyst
am 25 Apr. 2016
Just put it as a line in your program, or type it at the prompt in the command window.
ElizabethR
am 26 Apr. 2016
Bearbeitet: ElizabethR
am 26 Apr. 2016
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
