problem with fzero in my code
2 ビュー (過去 30 日間)
古いコメントを表示
fzero won´t work, anyone knows what may be the problem?
回答 (2 件)
Fabio Freschi
2019 年 10 月 14 日
your fun is neither acceppting nor using inputs
You should write the symbolic function like this
fun = @(x)cos(x);
x0 = fzero(fun,0.5);
8 件のコメント
Walter Roberson
2019 年 10 月 15 日
I do not understand what tangent lines through the origin for cosx has to do with xsinx ? Tangent lines to cosx would have to do with sinx not xsinx .
Ekemini Stephen
2019 年 10 月 14 日
Create a function file and save it to the same dierctory as
function y = f(x)
y = cos(x);
end
Then use this function in the section of your script as
%%
fun = @f; % function
x0 = 0.5; % initial point
ff = fzero(fun,x0);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Uncertain Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!