Plotting the output of a function
49 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
positron96
el 27 de Feb. de 2018
Comentada: positron96
el 27 de Feb. de 2018
I would like to plot the output of the integral function that I made (see below). Basically, I created a function that takes in constants and the function to be integrated. Then I want to plot the integral from t = 0 to t = 1.5. My code does not work. Can someone teach me what to do?
function V_out = homew(tau, Vin);
syms t
Vout = 1 / tau * int(Vin, t)
t = 0 : 0.1 : 1.5
plot(t, Vout)
2 comentarios
Jan
el 27 de Feb. de 2018
"Does not work" is not useful to describe a problem. Please explain, what happens.
Your t is a symbolic variable, but plot expects numerical values.
Respuesta aceptada
Birdman
el 27 de Feb. de 2018
Use subs command.
function V_out = homew(tau, Vin)
syms t
Vout = 1 / tau * int(Vin, t);
t = 0 : 0.1 : 1.5
Vout=subs(Vout,t)
plot(t, Vout)
Más respuestas (0)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!