Error in circularshift inside for loop.
10 次查看(过去 30 天)
显示 更早的评论
Hi,
I need your help
I get this error message
In an assignment A(I) = B, the number of elements in B and I must be the same
when execute this code:
x=[2 3 4 5 6 7 8 9 1]
for i=1:6
b(i)=circshift(x,[0,i])
end
Thanks..
0 个评论
回答(1 个)
Walter Roberson
2018-9-22
circshift() like that is going to return a vector. You are trying to store the vector into the single location b(i) .
You can create rows (or columns) of a 2D array, or you can use cell arrays.
另请参阅
类别
在 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!