Find the roots of the equation using MATLAB.
Afficher commentaires plus anciens
5 commentaires
What have you tried so far?
doc solve
doc fsolve
I would recommend you to read the Getting started part of the documentation. Few contributors are willing to do your work for you. Most are happy to help you understand Matlab. The two functions I suggested might be used to solve the problem, and the documentation comes with examples on how to use them.
Pelin
le 25 Déc 2012
Réponses (2)
Here's a simple example similar to ones given in the documentation for FZERO
>> fzero(@(x) x^2-1, 2)
ans =
1
Azzi Abdelmalek
le 25 Déc 2012
To solve
x+cos(x)=0
write and save this function (myeq.m)
function f=myeq(x)
f=x+cos(x)
then call in matlab command
x0=0
sol=fsolve(@myeq,x0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!