How to solve Regular Falsi Iteration Method using MATLAB??

7 Ansichten (letzte 30 Tage)
Ameer Hamza
Ameer Hamza am 14 Jan. 2021
Kommentiert: Ameer Hamza am 18 Jan. 2021
By using the False Position/ Regular Falsi Numerical method to find the positive root of the quadratic equation Correct to 3 significant figures:
f(x)=5x^2+11x-17
  2 Kommentare
James Tursa
James Tursa am 14 Jan. 2021
What have you done so far? What specific problems are you having with your code?
Ameer Hamza
Ameer Hamza am 18 Jan. 2021
clc
% Setting x as symbolic variable
syms x;
% Input Section
y = input('Enter non-linear equations: ');
a = input('Enter first guess: ');
b = input('Enter second guess: ');
e = input('Tolerable error: ');
% Finding Functional Value
fa = eval(subs(y,x,a));
fb = eval(subs(y,x,b));
% Implementing Bisection Method
if fa*fb > 0
disp('Given initial values do not bracket the root.');
else
c = a - (a-b) * fa/(fa-fb);
fc = eval(subs(y,x,c));
As you can see my above coding, however it is showing an error...
Enter non-linear equations: 5*x^2+11*x-17
Enter first guess: 1
Enter second guess: 2
Tolerable error: 0.0001
??? Undefined function or method 'eval' for input arguments of type 'double'.
Error in ==> Untitled4 at 13
fa = eval(subs(y,x,a));
Kindly help me out??

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by