I want to derive 3 subsets of data using one input data, but I am don't know how to save them to 3 files. There must be something wrong with the syntax? What is the correct syntax of saving files?
Thank you so much
function [data2,data3,data4]=clean_data(file)load(file);jj=1;for ii=1:length(data) if(~isnan(data(ii,2))) data2(jj,:)=data(ii,:); jj=jj+1; end end ll=1;for kk=1:length(data2) if(data2(kk,2)==1) data3(ll,:)=data2(kk,:) ll=ll+1; endend mm=1; for kk=1:length(data2) if(data2(kk,2)==0) data4(mm,:)=data2(kk,:) mm=mm+1; end end save('clean_data','newdataC','newdataE') end
Best Answer