x = linspace(0,10,100);
y = 3*exp(-x/3)*sin(pi*x);
plot(x, y)
xlabel('Time in Seconds')
ylabel('Voltage over time')

Respuestas (1)

Voss
Voss el 4 de Dic. de 2021

0 votos

You have to use .* (element-wise multiplication) rather than * (matrix multiplication):
y = 3*exp(-x/3).*sin(pi*x);

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 4 de Dic. de 2021

Comentada:

el 4 de Dic. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by