MATLAB: How to solve this equation MATLABsolve equation Hi,everyone,there is a equation as followed: f(x)=h0*f(x)+h1*f(x-1)+h2*f(x-2)+h3*f(x-3); The values of the h0~h3 are given,then how to solve this equation? thank you! Best Answer You need three values of f(x) in order to completely solve the equation.Or it can be expressed in terms of the known constants together with the unknown f(0), f(1), f(2)sum(-((h0 - 1 + R .* h1 + h2 * R.^2) .* f(0) + R .* ((h0 - 1 + R .* h1) .* f(1) + R .* f(2) .* (h0 - 1))) .* (1./R)^x ./ (3 * h3 .* R.^3 + 2 * h2 .* R.^2 + R * h1)whereR = roots([h3, h2, h1, h0-1]);Note: all three roots of R must be included, even if imaginary! Related SolutionsMATLAB: Calculating a function and drawing a graph syms xf=sin(x)/(x^2+1);fplot(f) derivative=diff(f,x)derivative_when_x_equals_one=double(subs(derivative,x,1)) MATLAB: How can i change x to (x+h) I am not certain what problem you are having. You have to define all the values you pass to your function as arguments before calling your function. Example —f = @(x) x.^2- 4;h = 1E-8;dfdx = @(f,x,h) (f(x+h) - f(x))./h;x = 4;fval = f(x)derv = dfdx(f,x,h) Related QuestionConstruction of diagonal matrix of functionsHow to define a special function with some pointsDecimal places for value stored
Best Answer