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

조회 수: 20 (최근 30일)
Alejandra Caballero
Alejandra Caballero 2020년 10월 22일
답변: galang andaru ibnu tetuko 2021년 7월 24일
x = -pi:2*pi;
f(x) = (cos(2.*x));
plot (f)

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 22일
x = -pi:2*pi;
f = cos(2.*x); % f(x) is wrong
plot(x, f)
  댓글 수: 3
Stephen23
Stephen23 2020년 10월 22일
편집: Stephen23 2020년 10월 22일
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 2020년 10월 23일
@Stephen Cobeldick: Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

galang andaru ibnu tetuko
galang andaru ibnu tetuko 2021년 7월 24일
how to find max value and error of cos(2x)

카테고리

Help CenterFile Exchange에서 MuPAD에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by