Performance Problem with loop-code
Mostra commenti meno recenti
Hello,
is there a possibility to increase the performance of the following MatLab program? It's really slow... 'A' describes a structured array with more than 100 fields. C and D are normal matrices.
Thanks a lot!
Best regard Philipp
T_dummy=12;
for k =1:numel(fields_A)
B_dummy = NaN(12,size(A.(fields_A{k}),1));
for c=1:size(A.(fields_A{k}),1)
for t=T_dummy-11:T_dummy
B_dummy(t-T_dummy+12,c) = C(t,A.(fields_A{k})(c,1)) + D(t,A.(fields_A{k})(c,2));
B.(['t_' int2str(k)]) = B_dummy;
end
end
T_dummy=T_dummy+1;
end
clear B_dummy T_Dummy
1 Commento
per isakson
il 17 Feb 2012
Did you try the profiler?
Risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!