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

20 ビュー (過去 30 日間)
Alejandra Caballero
Alejandra Caballero 2020 年 10 月 22 日
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 Center および File ExchangeMuPAD についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by