Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I am getting an error for the below eqn . I wrote coding in matlab function (user defined function in simulink),so please help with this.I have also attached my simulink model.

1 visualización (últimos 30 días)
function y = fcn(h,u)
A = [0 1;-1 1];
B = [0;1];
N = 300;
y = zeros(1,500);
t = 0:25
for i = 1:N
y = (h/N)*exp(i*A*(h/N)).*B*u(t-(i*(h/N)));

Respuestas (1)

madhan ravi
madhan ravi el 3 de Nov. de 2018
Editada: madhan ravi el 3 de Nov. de 2018
function y = fcn(h,u)
A = [0 1;-1 1];
B = [0;1];
N = 300;
y = zeros(1,500);
t = 0:25
for i = 1:N
y(i)= (h/N)*exp(i*A*(h/N)).*B*u(t-(i*(h/N)));
end
y
end
  4 comentarios
Chiliveri Vinod
Chiliveri Vinod el 14 de Nov. de 2018
thank u for the answer but i want the output as (2,1) dimension ,it is getting as (1,500)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by