Delete the first element from each first row inside the cell array

14 ビュー (過去 30 日間)
Daria Ivanchenko
Daria Ivanchenko 2020 年 11 月 5 日
コメント済み: Daria Ivanchenko 2020 年 11 月 5 日
Hi!
How can I delete the very first element from the first row in every cell array? Number of rows inside each cell array is always 1, number of columns is different.
Example:
A = {[1 2 3 4 5]; [1 2 3 4 5 6]; [1 2 3 4]; [1 2 3 4 5 6 7]}; % in the beginning
A = {[2 3 4 5]; [2 3 4 5 6]; [2 3 4]; [2 3 4 5 6 7]}; % in the end
Thanks!

採用された回答

Sriram Tadavarty
Sriram Tadavarty 2020 年 11 月 5 日
Hi Daria,
You can try
A1 = cellfun(@(x) x(2:end), A, 'UniformOutput', false)
For more information about cellfun, look here.
Hope this helps.
Regards,
Sriram

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