problem with fzero in my code
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
fzero won´t work, anyone knows what may be the problem?
![Skärmavbild 2019-10-14 kl. 08.29.30.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242512/Sk%C3%A4rmavbild%202019-10-14%20kl.%2008.29.30.png)
Risposte (2)
Fabio Freschi
il 14 Ott 2019
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 Commenti
Walter Roberson
il 15 Ott 2019
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
il 14 Ott 2019
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 Commenti
Vedere anche
Categorie
Scopri di più su Uncertain Models in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!