Plotting the derivative of a non symbolically defined function
Ältere Kommentare anzeigen
I've solved a second order nonlinear differential equation in matlab and would like to plot it's derivative:
my attempts so far:
syms phi(t)
figure
hold on
for v =1:10
[V] = odeToVectorField(diff(phi,2)== 28*(0.45-0.136)-(0.9)^2 * 0.45*1.21*sqrt(2)*v^2*sin(phi)*sin(pi/4-phi)/(4*0.25));
M = matlabFunction(V,'vars', {'t','Y'});
sol = ode45(M,[0 20],[0 5]);
fplot(@(x)deval(sol,x,1), [0, 20])
end
ddt = gradient(phi(:)) ./ gradient(t(:));
fplot(ddt)
Doing this returns an error. I've also tried
y =diff(phi)
fplot(y)
which just does nothing.
Any help would be great!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!