How to remove first 19 rows from a multidimensional cell array

1 回表示 (過去 30 日間)
Kafayat Olayinka
Kafayat Olayinka 2020 年 8 月 4 日
コメント済み: Kafayat Olayinka 2020 年 8 月 4 日
I have a multidimentional cell array, A(1by 4 cell array)
Each cell contains
A{1,1} has [100,10]
A{1,2} has [100,11]
A{1,3} has [100,10]
A{1,4} has [100,15]
I will like to remove the first 20 rows from each cell array. So I end up with
A{1,1} has [80,10]
A{1,2} has [80,11]
A{1,3} has [80,10]
A{1,4} has [80,15]

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 8 月 4 日
編集済み: Cris LaPierre 2020 年 8 月 4 日
Use a cellfun.
% Setup
A(1)={rand(100,10)};
A(2)={rand(100,11)};
A(3)={rand(100,10)};
A(4)={rand(100,15)};
% Remove first 20 rows
B = cellfun(@(x) x(21:end,:),A,'UniformOutput',false)

その他の回答 (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