How to select the part of the tables in a cell?

1 回表示 (過去 30 日間)
BN
BN 2020 年 1 月 14 日
コメント済み: BN 2020 年 1 月 15 日
I have a 1*125 cell named "C". inside C I have 125 tables (456*12 tables). I want only part of these tables from row number 98 to row number 456. in fact, I want to remove first 97 rows of all tables in the C. (it's like 98:456*12 - row 1 to row 97 deleted).
I was attached to C for you.
if any other question you have I would answer so quick.
thank you all.
  2 件のコメント
Adam Danz
Adam Danz 2020 年 1 月 14 日
Seeing data being deleted gives me the chills.
As an alternative to dpb's perfectly fine answer, you could create an index variable that merely selects rows 98:456 any time you want to perform an action on them. This isn't always a viable solution but when possible, use indexing rather than deleting data.
idx = false(456,1);
idx(98:456) = true;
% Example of listing all unique values in column 5
% for rows 98:456
cellfun(@(x)unique(x(idx,5)), C, 'uni',false)
dpb
dpb 2020 年 1 月 14 日
"Seeing data being deleted gives me the chills.
Then replace C w/ c and use t(1:N1-1,:) to keep a copy of the first section if it really isn't trash as the original posting says.

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

採用された回答

dpb
dpb 2020 年 1 月 14 日
編集済み: dpb 2020 年 1 月 15 日
N1=98;
C=cellfun(@(t) t(N1:end,:),C,'uni',0);
  1 件のコメント
BN
BN 2020 年 1 月 15 日
dpb and Adam Danz, thank you.

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

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