Performance Problem with loop-code

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

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Asked:

on 17 Feb 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!