Anyone know why it isnt accepting my cos(2x) ?

20 visualizaciones (últimos 30 días)
Alejandra Caballero
Alejandra Caballero el 22 de Oct. de 2020
Respondida: galang andaru ibnu tetuko el 24 de Jul. de 2021
x = -pi:2*pi;
f(x) = (cos(2.*x));
plot (f)

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 22 de Oct. de 2020
x = -pi:2*pi;
f = cos(2.*x); % f(x) is wrong
plot(x, f)
  3 comentarios
Stephen23
Stephen23 el 22 de Oct. de 2020
Editada: Stephen23 el 22 de Oct. de 2020
e is not a defined constant. Use exp(x) to calculate e^x
Most likely you will also need element-wise division here:
h = (x^2-x+3)./(x-8);
% ^^
unless you really are trying to solve systems of linear equations.
Ameer Hamza
Ameer Hamza el 23 de Oct. de 2020
@Stephen Cobeldick: Thank you!

Iniciar sesión para comentar.

Más respuestas (1)

galang andaru ibnu tetuko
galang andaru ibnu tetuko el 24 de Jul. de 2021
how to find max value and error of cos(2x)

Categorías

Más información sobre MuPAD en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by