Performance Problem with loop-code
Show older comments
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 Comment
per isakson
on 17 Feb 2012
Did you try the profiler?
Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!