Hi Friends(adsbygoogle = window.adsbygoogle || []).push({});

I want to plot variables (b,u) that are in function "step" .

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;

but these variables are unknown in function "main".

thanks.

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# ODE matlab

Loading...

Similar Threads - matlab | Date |
---|---|

How to program this in Matlab | Feb 28, 2018 |

Matlab Making a short test for self-adjointness | Feb 23, 2018 |

Matlab Plotting Coordinate Transformations in Matlab | Feb 12, 2018 |

Matlab Plotting animations (time-evolution) | Jan 17, 2018 |

**Physics Forums - The Fusion of Science and Community**