What's wrong in the code? I cant generate the same graph as the question required.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Kai Wing YU
el 17 de Nov. de 2021
Respondida: Yusuf Suer Erdem
el 17 de Nov. de 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/803024/image.png)
function y = f(x)
x = -5:5;
y = sin(x.^2).*exp(cos(x));
plot(x,y)
end
Respuesta aceptada
Más respuestas (1)
Yusuf Suer Erdem
el 17 de Nov. de 2021
x = linspace(-5,5);
k = sin(x.^2);
l= exp(cos(x));
y = k.*l;
plot(x,y)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/803044/image.png)
USE THIS WAY, IT HELPS. I THINK YOU WERE JUST MISSING 'LINSPACE' COMMAND. GOOD LUCK!
0 comentarios
Ver también
Categorías
Más información sobre Directed Graphs 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!