Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [t,y] = euler_step(A,B,C,D,dt,T)
- t = 0:T:dt;
- n = length(t);
- x = zeros(1,n+1);
- y = zeros(1,n);
- for i=1:n
- x(1,i+1)=(A*x(1,i)+B)*dt+x(1,i);
- y(1,i)=C*x(1,i)+D;
- end
- [t,y] = euler_step(0,4,1,0,1,10);
- plot(y,t);
- echo off all;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement