MATLAB: How do i find a difference equation

difference

I have this first order differential equation given:
i need to find a difference equation using MATLAB. I would appreciate if someone could help me with that. Thanks

Best Answer

Choose your sample time Te
Te=0.1 % Your sample time
N=1.5
D=[1 -0.5]
Modelc=tf(N,D) % Your continue transfer function
Modeld=c2d(Modelc,Te) % Your discrete transfer function
[Nd,Dd]=tfdata(Modeld,'v');
% From Y(z)/U(z)=Nd(z)/Dd(z) you can find the relation between y{n] and u[n]