Using fzero on function

2 ビュー (過去 30 日間)
Pawel Krenz
Pawel Krenz 2021 年 1 月 3 日
コメント済み: Pawel Krenz 2021 年 1 月 3 日
Trying to make a function in Q2 and plotting it in Q2_answer as well as finding the two roots using fzero. I do recive "Not enough input arguments." and I don't understand how to solve this.
function y = Q2(x)
y = x.^6-2.*cos(x);
end
x0 = 2; % initial point
x = linspace(-3,3,100);
plot(x,Q2);
z = fzero(Q2,x0)

採用された回答

David Hill
David Hill 2021 年 1 月 3 日
y=@(x)x.^6-2.*cos(x);
x=linspace(-3,3,100);
plot(x,y(x));
z(1)=fzero(y,-1);
z(2)=fzero(y,1);
  1 件のコメント
Pawel Krenz
Pawel Krenz 2021 年 1 月 3 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by