Assignment has more non-singleton rhs dimensions than non-singleton subscripts ERROR IN FOR LOOP

1 visualización (últimos 30 días)
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

Respuesta aceptada

James Tursa
James Tursa el 16 de En. de 2021
Editada: James Tursa el 16 de En. de 2021
x(:,i+1)=x(:,i)+A*x(:,i)+B*u(:,i); % changed u(i) to u(:,i)

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by