Can someone tell how I should code this equation for plot
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
raveen abeywardana
el 6 de Oct. de 2021
Comentada: Star Strider
el 6 de Oct. de 2021
x(t)=0.8cos(14t) this is my equation and i'm unable to plot this equation. It show me a error "Array indices must be positive integers or logical values."
0 comentarios
Respuesta aceptada
Star Strider
el 6 de Oct. de 2021
That would work (with multiplication operators) in the Symbolic Math Toolbox —
syms t
x(t)=0.8*cos(14*t)
figure
fplot(x, [-2*pi 2*pi])
grid
It would need to be coded as an anonymous function to use it numerically —
x = @(t) 0.8*cos(14*t);
t = linspace(-2*pi, 2*pi, 500);
figure
plot(t, x(t))
grid
.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots 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!