How to Find root of continuous function of one vector
3 views (last 30 days)
Show older comments
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
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'))
Answers (0)
See Also
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!