Find smallest cell in cell array

조회 수: 8 (최근 30일)
Philip
Philip 2012년 4월 19일
Is there a way to find the smallest sized cell in a cell array?
Thanks!

채택된 답변

Walter Roberson
Walter Roberson 2012년 4월 19일
What is "size" in this context? Number of rows? Number of columns? Number of elements? Storage requirement?
Which is smaller:
'fdoafodsif-0dsi0-0-dfs0-fds0--ds'
or
struct('foo',3,'bar',7)
?
  댓글 수: 4
Philip
Philip 2012년 4월 19일
That worked perfectly, thanks so much!
Jan
Jan 2012년 4월 19일
Or slightly faster:
[minsize, minidx] = min(cellfun('size', YourCell, 2));

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by