How can I accelerate my Matlab program
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everybody, the working of the my matlab program durate very long, and i want to short the operation time. I write the outline of the my program below.
f=(400:1000);
q=5;
m=5;
rk=4096;
f1=length(f);
for a=1:f1
for b=1:q
for c=1:m
for d=1:rk
end
end
end
end
Also, how can be shorted the operation time of the any matlab program?
2 Kommentare
Voss
am 14 Mai 2022
Here's an outline of a solution:
f=(400:1000);
q=5;
m=5;
rk=4096;
f1=length(f);
% use vectorized operations instead of for loops
It's possible that the operations inside the for loops can be vectorized, which will very likely speed up the program. However, without knowing what those operations are, it's not possible to say the extent to which vectorization is possible or how to do it. Please share the full code.
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!