Why won't my function graph?
Mostra commenti meno recenti
x = linspace(0,10,100);
y = 3*exp(-x/3)*sin(pi*x);
plot(x, y)
xlabel('Time in Seconds')
ylabel('Voltage over time')
Risposte (1)
Voss
il 4 Dic 2021
You have to use .* (element-wise multiplication) rather than * (matrix multiplication):
y = 3*exp(-x/3).*sin(pi*x);
1 Commento
Ethan Gomez
il 4 Dic 2021
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!