Assignment has more non-singleton rhs dimensions than non-singleton subscripts ERROR IN FOR LOOP
1 次查看(过去 30 天)
显示 更早的评论
hi every one
I have written this code But the error is showen
clear,clc
N = 5;
A = eye(6);
B = zeros(6,3);
u = zeros(3,N)
x = zeros(6,N); x(:,1)=[1;1;1;1;1;1];
for i=1:N
x(:,i+1)=x(:,i)+A*x(:,i)+B*u(i);
end
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
0 个评论
采纳的回答
James Tursa
2021-1-16
编辑:James Tursa
2021-1-16
x(:,i+1)=x(:,i)+A*x(:,i)+B*u(:,i); % changed u(i) to u(:,i)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!