MATLAB: Can’t see differential equation’s result in the command window

command windowdifferential equationsdoens'tresultshowsolve

I've been solving some basic differential equations, and for some reason the command window doesn't show the result. It also seems that matlab does finish the calculation.
Yesterday I was able to show the result once, but it only showed up after I put the simplify function in there. Matlab restarting didn't help either.
here is the code for a closer look.
syms v(t)
cond = v(0) == 40;
ode = diff(v,t) + 0.1 / 0.01 * v == 10;
vSol(t) = dsolve(ode,cond);
vSol = simplify(vSol);

Best Answer

  • It is because that you put semicolon. Putting semicolon automatically hides the code from being displayed in command line. Type
    vSol
    in command line and you should see the solution.