FAQ: How can I process a sequence of files?
Afficher commentaires plus anciens
How can I process a sequence of files?
3 commentaires
Salah Djerouni
le 15 Fév 2020
Hi Jan
can i ask you some question because i have a problem for save result in matlab
my probleme is i run matlab with three loops (for...end ) and i want to save the result every change iterataion loop.
if you possible to help me .
thanks Jan
Walter Roberson
le 16 Fév 2020
Pre-allocate an output array that is at least 3 dimensions, with one dimension being the number of times the first loop will execute, a second dimension being the number of times the second loop will execute, and the third dimension being the number of times the third loop will execute. Then assign to the output according to how many loop iterations you have done.
For example,
Lvals = [-83, 149, -5, 0, -2, 101];
numL = length(Lvals);
output = zeros(7, 3, numL);
for J = 9:17:11
Jidx = round((J-9)/17) + 1;
for K = 1000:500:2000
Kidx = round((K-500)/500);
for Lidx = 1 : numL
L = Lvals(Lidx);
output(Jidx, Kidx, L) = J.^2 + K/7 + sin(L.^3);
end
end
end
Réponse acceptée
Plus de réponses (2)
Sean de Wolski
le 31 Mai 2013
1 vote
Examples in the documentation:
3 commentaires
Jan
le 31 Mai 2013
Image Analyst
le 31 Mai 2013
Was not me.
Sean de Wolski
le 3 Juin 2013
Nor me.
Sean de Wolski
le 29 Juil 2016
Modifié(e) : Sean de Wolski
le 29 Juil 2016
1 vote
In MATLAB R2014b and newer, you can use a datastore to read a sequence of files in a load-analyze-discard manner or in one shot with the readall() command.
1 commentaire
Ismail Qeshta
le 11 Nov 2017
Hi all. Thanks for sharing it. How about if my files are in permutations sequence such as, Data11, Data12, Data 13, etc. Also, what if I would like to plot two different files names within a folder? Regards.
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!