Find the roots of the equation using MATLAB.

the question is;
can anyone help me? I need the code.

5 commentaires

José-Luis
José-Luis le 25 Déc 2012
Modifié(e) : José-Luis le 25 Déc 2012
What have you tried so far?
doc solve
doc fsolve
Pelin
Pelin le 25 Déc 2012
Modifié(e) : Pelin le 25 Déc 2012
our teacher didn't teach us matlab. he said you can learn by yourself but i don't know anything about it. i just know a little c++.
José-Luis
José-Luis le 25 Déc 2012
Modifié(e) : José-Luis le 25 Déc 2012
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
Pelin le 25 Déc 2012
I want to understand, too. I watched some videos about matlab but I was confused. I'll try to understand again. Thank you for your suggestions :)

Connectez-vous pour commenter.

Réponses (2)

Matt J
Matt J le 25 Déc 2012
Modifié(e) : Matt J le 25 Déc 2012
Here's a simple example similar to ones given in the documentation for FZERO
>> fzero(@(x) x^2-1, 2)
ans =
1
Azzi Abdelmalek
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

Question posée :

le 25 Déc 2012

Community Treasure Hunt

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

Start Hunting!

Translated by