現在、Matlab2018bを使用し、アプリを作成しているのですが、処理を高速化させたい部分があります。
それはforループを使用して約25万回ループしている箇所です。
arrayfun関数を使用するとforループを使用しないで書くことができるようなのですが下記のような処理の場合でも
arrayfun関数でforループを使用せず書くことができるものでしょうか。
改善したい箇所は大体、下記のような感じになっており、最終的に25万行のデータSを作成したいと思っています。
S=zeros(250000, 1, 2);
for i=1:250000
Xp = [F1(:, i), F2(:, i)];
S(i, :, :) = Fn(:, i) * Xp' * Xp * Xp' * C;
end
4 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_750789
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_750789
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_751568
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_751568
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_752403
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_752403
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_752433
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/482062-arrayfun#comment_752433
Sign in to comment.