What's wrong in the code? I cant generate the same graph as the question required.
Mostra commenti meno recenti

function y = f(x)
x = -5:5;
y = sin(x.^2).*exp(cos(x));
plot(x,y)
end
1 Commento
Kai Wing YU
il 17 Nov 2021
Risposta accettata
Più risposte (1)
Yusuf Suer Erdem
il 17 Nov 2021
x = linspace(-5,5);
k = sin(x.^2);
l= exp(cos(x));
y = k.*l;
plot(x,y)

USE THIS WAY, IT HELPS. I THINK YOU WERE JUST MISSING 'LINSPACE' COMMAND. GOOD LUCK!
Categorie
Scopri di più su 2-D and 3-D Plots 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!
