How to Find root of continuous function of one vector

3 views (last 30 days)
I want to find ALL the y vectors that give me f(y)=0. Do you have a better function or method to do that ?
thanks
function [] = TryCode()
options = optimset('Display','Iter');
[sol,fval,exitflag] = fsolve(@MyFunc,zeros(1,5),options) ;
end
function f = MyFunc(y)
R1 = 0.5*(y(1)+y(2))+8*(y(1)-y(2));
R2 = 0.5*(y(2)+y(3))+8*(y(2)-y(3));
R3 = 0.5*(y(3)+y(4))+8*(y(3)-y(4));
R4 = 0.5*(y(4)+y(5))+8*(y(4)-y(5));
f = (1+R1)*(1+R2)*(1+R3)*(1+R4) - 1 ;
end
  2 Comments
Matt J
Matt J on 25 Jun 2015
Edited: Matt J on 25 Jun 2015
One equation in five unknowns? There are surely infinitely many solutions, probably not even countably many.
Mukul Rao
Mukul Rao on 26 Jun 2015
Edited: Mukul Rao on 26 Jun 2015
Try the non-linear system of equations solver in the symbolic toolbox. It has the capability to express solutions as a union of vector spaces.
web(fullfile(docroot, 'symbolic/mupad_ug/solve-algebraic-systems.html#math-solving-equations-systems-nonlinear'))

Sign in to comment.

Answers (0)

Categories

Find more on Systems of Nonlinear Equations 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!