Performance Problem with loop-code
Ältere Kommentare anzeigen
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 Kommentar
per isakson
am 17 Feb. 2012
Did you try the profiler?
Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!