Operation on cell array

1 回表示 (過去 30 日間)
Bolivar
Bolivar 2013 年 8 月 22 日
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

採用された回答

Azzi Abdelmalek
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 件のコメント
Bolivar
Bolivar 2013 年 8 月 22 日
編集済み: Bolivar 2013 年 8 月 22 日
thanks a lot! Please can you tell me how you did to learn matlab so quicly? I will love graps matlab as you do. tell me a little how you did or do?
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 30 日
Bolivar, I did not learn Matlab so quickly, I've started using Matlab in 1990.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by