how to make a script that plots all data loaded from to different repositories?
Mostra commenti meno recenti
hello! I must plot alot of data, so I would like to know if there is a way how to make a script that loop over all the data files in two different repositories and when the files have a similar number at the end of their names just plot them together. I hope I have made myself clear? any suggestions are very welcomed! thank you!
Risposta accettata
Più risposte (2)
3 Commenti
Walter Roberson
il 31 Mag 2017
Modificato: Walter Roberson
il 31 Mag 2017
Change
hold on;
F2= load(fullFileName2)
plot(F2.fdata);
legend('f1' , 'f2');
to
if exist(fullFileName2, 'file')
hold on;
F2 = load(fullFileName2)
plot(F2.fdata);
legend('f1' , 'f2');
hold off
else
legend('f1');
end
title(baseFileName);
pause(1);
Ano
il 31 Mag 2017
Walter Roberson
il 31 Mag 2017
You asked "when the files have a similar number at the end of their names just plot them together" . Perhaps the file names in the two directories are not identical, just matching in some part of interest to you. You should post a file name from the first directory and the corresponding file name from the second directory.
Ano
il 1 Giu 2017
1 Commento
Walter Roberson
il 1 Giu 2017
In what way does that help? You do not use filepattern2 in your code?
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!