extract elements from a cell array

1 回表示 (過去 30 日間)
pavlos
pavlos 2014 年 3 月 13 日
回答済み: Andrei Bobrov 2014 年 3 月 13 日
Hello,
Please help me with the following:
Consider a 3x1 cell array where its cells contain matrices as shown below:
C{1,1}= 206x89
C{2,1}= 78x89
C{3,1}= 108x89
How can I extract the first 20 elements of each matrix and stored them in a new cell?
The final matrices will be
206x20
78x20
108x20
Thank you very much.
Pavlos

採用された回答

Andrei Bobrov
Andrei Bobrov 2014 年 3 月 13 日
out = cellfun(@(x)x(:,1:20),C,'un',0);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by