How can I accelerate my Matlab program
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Voss
2022 年 5 月 14 日
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.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!