Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

ODE45

madjid222madjid222 Posts: 1Member
Hi Friends
I want to plot variables (b,u) that are in function step .
[b]function main
[t,v]=ode45('step',[0 20],0,[]);
plot(t,v)

function dv=step(t,v)
c1=1;
if t<10
u=1;
else
u=-1;
end
dv=c1*u-2*v;
b=dv/2;
[/b]
but these variables are unknown in function main.
thanks.
Sign In or Register to comment.