how to save all the data?

2 次查看(过去 30 天)
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 2015-7-31
For no obvious reason you removed the any from my answer:
Notdata = X(~any(idx,2),:);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by