How to create a Nx3 array from Nx4 array

Hi all,
If I have a 100x1 cell array which contains 100 Nx4 double array where N is a variable size, how to I create a new cell array which is also 100x1, but contains a Nx3 double array that contains just columns 2,3 and 4 of the previous Nx4 array?
Hope that make sense! I'd appreciate any help with this problem.
Thanks in advance!

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 27 日

0 投票

You can use cellfun()
C1; % 100x1 with Nx4 matrices
C2 = cellfun(@(x) {x(:,2:end)}, C1);

2 件のコメント

Amadeus Xu
Amadeus Xu 2020 年 11 月 27 日
Thank you Ameer, that works perfectly!
Ameer Hamza
Ameer Hamza 2020 年 11 月 27 日
I am glad to be of help!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCell Arrays についてさらに検索

質問済み:

2020 年 11 月 27 日

コメント済み:

2020 年 11 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by