Operation on cell array
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a cell array looking as follow:
>>c
[3*2 double]
[7*2 double]
[2*2 double]
[12*2 double]
The plot is the result of the command in matlab prompt. I want to find out the smallest and the largest array in the cell. Is there any matlab built-in function which can help me performe such and operation? or do you have a cloud to do this?
thanks for your support
bolivar
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 8월 22일
편집: Azzi Abdelmalek
2013년 8월 22일
a={rand(3,2) ;rand(7,2);rand(2,2);rand(12,2)} % Example
id=cellfun(@numel,a)
[~,max_idx]=max(id)
array_max=a{max_idx}
[~,min_idx]=min(id)
array_min=a{min_idx}
댓글 수: 2
Azzi Abdelmalek
2013년 8월 30일
Bolivar, I did not learn Matlab so quickly, I've started using Matlab in 1990.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!