Nested for loops - FOR expression comma separated list Error
1 次查看(过去 30 天)
显示 更早的评论
When I try to run this code:
A = zeros(30000, NV);
counter = 1;
for k = 1:P
for n = GN(:,k)
for i = AT{n}
A(counter, pMap(i,1,1)) = - w(i,k);
end
counter = counter + 1;
end
end
I am getting this error: "FOR expression comma separated list must have exactly one item".
I am not sure what is going on.
NV is some number like 7000.
GN is a matrix of the form
[1 2 3;
2 3 4;
3 4 5]
AT is a cell array where its entries are arrays of the form:
AT{1} = [1 2 3 4 5 6 7 8 9 10];
AT{2} = [11 12 13 14 15 16 17 18 19 20]; etc...
Any help would be appreciated.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!