how to save all the data?

2 ビュー (過去 30 日間)
Amr Hashem
Amr Hashem 2015 年 7 月 31 日
コメント済み: Amr Hashem 2015 年 8 月 1 日
I am using this code to search for a word in a cell, and save all the row:
D=alldata(:,1:5);
idx = cellfun('isclass',D,'char');
idx(idx)=~cellfun('isempty',regexp(D(idx),'BATTERY')) ;
data = alldata(any(idx,2),:);
and I want to save the not " battery" cells (the rest of the file)
so I use:
Notdata = X(~idx,:);
but it didn't work...:(
what is wrong?
  3 件のコメント
Amr Hashem
Amr Hashem 2015 年 7 月 31 日
here is a sample:
where I search for a word 'ex: battery ... ' and save ans (rows) in data
and I want to save the rest in Notdata, to be capable of start a new search in Notdata ....etc.
Stephen23
Stephen23 2015 年 7 月 31 日

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

採用された回答

Stephen23
Stephen23 2015 年 7 月 31 日
編集済み: Stephen23 2015 年 7 月 31 日
For no obvious reason you removed the any from my answer:
Notdata = X(~any(idx,2),:);
  1 件のコメント
Amr Hashem
Amr Hashem 2015 年 8 月 1 日
Thanks alot Stephen...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePropulsion and Power Systems についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by