Find the roots of the equation using MATLAB.
Show older comments
5 Comments
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
on 25 Dec 2012
Answers (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
on 25 Dec 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)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!