Borrar filtros
Borrar filtros

simulate this using script file (time evolution)

2 visualizaciones (últimos 30 días)
Jeffrey Eiyike
Jeffrey Eiyike el 13 de Jul. de 2016
Respondida: Div Tiwari el 9 de Ag. de 2016
dx(t)= Bu(t)+ c(t)
I want to simulate the next state for every time steps using m-script..
x(t+1)= x(t) + Bu(t)+ c(t)
It is not working the way I want.

Respuestas (1)

Div Tiwari
Div Tiwari el 9 de Ag. de 2016
Could you elaborate on what you meant by it not working the way you want, Jeffrey? This should be quite simple to implement, but we do need to specify an initial value and index the for-loop correctly. For example, for 'N' steps:
x = zeros(1,N);
x(1) = xInitial; % Set initial value
for t = 1:N-1
% Assuming Bu and c are precomputed
x(t+1) = x(t) + Bu(t) + c(t);
end

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by