whileループからparforループへの変換
Afficher commentaires plus anciens
forループ文をparforループを使用して時間の短縮を行いたいです。
コード本文は1次元csvに対して3000ずつ1データずらしでで切り取りを行っているのですが、forをparforに変更した際にこういったエラーが出ます。
parfor文のドキュメンテーションを見てもいまいちピンと来ないのでどこが間違っているのかご教授願いたいです。
原文
data = csvread('C:\Users\test\.csv'); % Put Data
data = transpose(data);
G = gpuArray(data);
L = length(data);
S = 3000; % Space
K = L-S+1;
for n =1:L-S+1;
t = data(n:n+S-1);
filename = ['C:\Users\test\test',num2str(n),'ch2.csv']; % Put Data name 'test'
csvwrite(filename, t);
n = n + 1;
end
エラー文
Error:Assigning to the loop variable "i" of a parfor is not allowed.
See Parallel for Loops in MATLAB, "Loop Variable".
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur ループと条件付きステートメント dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!