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 CenterFile Exchange에서 Propulsion and Power Systems에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by