how to save all the data?

2 vues (au cours des 30 derniers jours)
Amr Hashem
Amr Hashem le 31 Juil 2015
Commenté : Amr Hashem le 1 Août 2015
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 commentaires
Amr Hashem
Amr Hashem le 31 Juil 2015
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 le 31 Juil 2015

Connectez-vous pour commenter.

Réponse acceptée

Stephen23
Stephen23 le 31 Juil 2015
Modifié(e) : Stephen23 le 31 Juil 2015
For no obvious reason you removed the any from my answer:
Notdata = X(~any(idx,2),:);
  1 commentaire
Amr Hashem
Amr Hashem le 1 Août 2015
Thanks alot Stephen...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Propulsion and Power Systems dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by