Find the roots of the equation using MATLAB.

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

5 Comments

What have you tried so far?
doc solve
doc fsolve
Pelin
Pelin on 25 Dec 2012
Edited: Pelin on 25 Dec 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 on 25 Dec 2012
Edited: José-Luis on 25 Dec 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.
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 :)

Sign in to comment.

Answers (2)

Matt J
Matt J on 25 Dec 2012
Edited: Matt J on 25 Dec 2012
Here's a simple example similar to ones given in the documentation for FZERO
>> fzero(@(x) x^2-1, 2)
ans =
1
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)

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 25 Dec 2012

Community Treasure Hunt

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

Start Hunting!