How can I accelerate my Matlab program
3 views (last 30 days)
Show older comments
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 Comments
Voss
on 14 May 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.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!