how to make cell2mat for many column to one vector ?

조회 수: 1 (최근 30일)
ElizabethR
ElizabethR 2016년 4월 24일
댓글: ElizabethR 2016년 4월 26일
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
ElizabethR
ElizabethR 2016년 4월 24일
Thanks for answare,
ooh i am sorry, this is the right image:
the variable i want process is "nilai" .. yes, i want to get the maximum value from value in column to 5 is it possible that i get the maximum from complex values ?
Stephen23
Stephen23 2016년 4월 25일
편집: Stephen23 2016년 4월 25일
@eliz: instead of asking random strangers why not just simply read the MATLAB documentation max, and see what it says about complex numbers. The documentation is great: it tells us how MATLAB works.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2016년 4월 24일
Perhaps something like:
V = [b{:, 2:5}]
  댓글 수: 4
ElizabethR
ElizabethR 2016년 4월 24일
yes i see, but i mean, is possible that i get the maximum value from complex number ?
ElizabethR
ElizabethR 2016년 4월 26일
@Jan Simon how to get all value only from column 2 ?? thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 4월 24일
Did you try something like this
col5 = nilai{:, 5};
magCol5 = abs(col5);
[maxValue, indexOfMax] = max(magCol5)
  댓글 수: 5
Image Analyst
Image Analyst 2016년 4월 25일
Just put it as a line in your program, or type it at the prompt in the command window.
ElizabethR
ElizabethR 2016년 4월 26일
편집: ElizabethR 2016년 4월 26일
i have been tried it. thanks yo so much image analyst ^^ whether the format long g convert a decimal number with lots value after the comma to only 14 number after the comma?? i try to using format long g in my function, but this output is same like i don't use format long g thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by