MATLAB: Help to solv a equation with iteration iteration solv I need help, how do i make a code in matlab for iterate the following eq: x=0.46-0.5*cos(3.14*(y/d))+0.004*cos(2*3.14*(y/d)) where y is the only unknown constant? i know the value of x and d. Best Answer hi Clauss,there are many ways to solve the equation, but with iterations i have few ideas : there is a method called Bisection : d=1.3; % I SUPPOSED d=1.3 f=@(y) 0.46-0.5*cos(3.14*(y/d))+0.004*cos(2*3.14*(y/d)) format long eps_abs = 1e-5; eps_step = 1e-5; a = 70.0; % Initial Guess to your function such that f(a)>0. b = 78.0; % Initial Guess to your function such that f(b)<0. while (b - a >= eps_step || ( abs( f(a) ) >= eps_abs && abs( f(b) ) >= eps_abs ) ) c = (a + b)/2; if ( f(c) == 0 ) break; elseif ( f(a)*f(c) < 0 ) b = c; else a = c; endend Related SolutionsMATLAB: Bisection iteration wither different values than 0 To solve f(y) = 0.2, define f1(y) = f(y) - 0.2, and then solve for f1(y) = 0. MATLAB: Newton Raphson Method for 4 equations You cannot find those values with the information specified, as you do not have any equations indicating what "y" or B or J should equal. Without those equations to provide constraints, h, k, and l may be anything. Related QuestionError: “Not enough input arguments. Error in f (line 2) y = (x.^3) – 2.” I also want to verify that this code is using the bisection method to estimate a zero until two successive estimates have a diff. less than 10-6.Display Results as nicely formatted tableTwo equations of two unknown anglesHow to code this Newton-Raphson and Secant Methods
Best Answer