Save data sets in different places
Show older comments
the output result only saves the last (unusual1.dat) file instead of all three.
if f==1 save Norm.dat stats -ascii %Save data to dat file using ascii
else if f==2 save Unusual.dat stats -ascii
else
save Unusual2.dat stats -ascii
end
end
Could you help me where is my problem, please?
Accepted Answer
More Answers (1)
Image Analyst
on 19 Aug 2018
Edited: Image Analyst
on 19 Aug 2018
I guess then that f never obtains the value of anything other than 1 or 2.
In your loop, construct the file name with sprintf and use that instead of the multiple if block:
filename = sprintf('Unusual%d.dat', f);
save filename stats -ascii
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!