Triangle wave starting at the origin
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
David Cuenca
el 8 de Feb. de 2022
Comentada: David Cuenca
el 8 de Feb. de 2022
Hi, I want my triangle wave to start at the origin, how can I do that?
This is my code:
t = linspace(0,6.840,10000);
x = 19.6.*sawtooth(t,0.5);
plot(t,x)
grid on
xticks([0 1 2 3 4 5 6 6.840])
yticks([-19.6 -15:5:15 19.6])
0 comentarios
Respuesta aceptada
DGM
el 8 de Feb. de 2022
You can just offset t
t = linspace(0,6.840,10000);
x = 19.6.*sawtooth(t+pi/2,0.5);
plot(t,x)
grid on
xticks([0 1 2 3 4 5 6 6.840])
yticks([-19.6 -15:5:15 19.6])
Más respuestas (1)
Walter Roberson
el 8 de Feb. de 2022
t = linspace(0,6.840,10000);
x = 19.6.*(1 + sawtooth(t,0.5));
plot(t,x)
grid on
xticks([0 1 2 3 4 5 6 6.840])
yticks([-19.6 -15:5:15 19.6])
0 comentarios
Ver también
Categorías
Más información sobre Axis Labels 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!


