Unclassified variables in a parfor loop

1 次查看(过去 30 天)
I am trying to do something like the following:
parfor i= xystart:xyend
....
xycount = i - xystart + 1;
A = zeros(nx,ny); B = A;
for n=1:Nn;
for m=1:Mm;
A(m,n)= <some expression>;
B(m,n)= <some expression>;
end
end
C(xycount,:,:) = A. * B;
end
I am getting an error message saying that 'C' is an unclassified variable. The above snippet is not the actual code which is quite big. But I hope the lines above convey what am I trying to do. Any idea what am I doing wrong?
Thanks!

采纳的回答

Matt J
Matt J 2020-3-17
parfor i= 1:xyend-xystart+1
....
A = zeros(nx,ny); B = A;
for n=1:Nn;
for m=1:Mm;
A(m,n)= <some expression>;
B(m,n)= <some expression>;
end
end
C(i,:,:) = A. * B;
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by