Error plotting my graph.
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This is my code. The error is: Error using plot Data must be numeric, datetime, duration or an array convertible to double. I am not sure what is causing this.
t = [0:0.1:6*pi];
syms k omega t
S1 = symsum(cos(2*k*omega*t)/(4*k^2 - 1) , k,[1; Inf]);
y = 1/pi + 0.5*sin(omega*t) - (2/pi)*S1;
plot(t,y)
3 comentarios
Respuestas (1)
Star Strider
el 4 de Dic. de 2017
Use fplot (with a single value for ‘omega’) or fsurf (with a range of values for ‘omega’).
This works:
syms k omega t
S1 = symsum(cos(2*k*omega*t)/(4*k^2 - 1) , k,[1; Inf]);
y(t,omega) = 1/pi + 0.5*sin(omega*t) - (2/pi)*S1;
fplot(y(t, pi/6), [0 6*pi])
I tried fsurf as well, however it takes forever so I stopped it.
0 comentarios
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!