I am trying to give an option (in row 15) of making sure you selected the right option. so, I wrote disp('if that correct type (1) if is not correct type(2) and it seem is not working. please help.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
disp('0. Graphical')
disp('1. Incremental Search')
disp('2. Bisection Method')
disp('3. False Position Method')
disp('4. Fixed Point Iteration')
disp('5. Newton Raphson')
disp('6. Secant')
disp('7. Modified Secant')
disp('__________________________________')
disp(' ')
meth = input('Select Method (0 through 7):');
switch meth
case 0
disp(' ')
disp('You been Have Selected Graphical Method')
disp('if that Correct type (1) if is not correct type (2)')
func = input('Primary Function (@(x)):');
if isempty(func)
error('Must Enter a Function. Start again.'),
end
xL = input('Lower Interval Limit: ');
if isempty(xL)
error('Must Enter a Lower Limit. Start again. ');
end
xU = input('Upper Interval Limit: ');
if isempty(xU)
error('Must Enter an Upper limit. Start again.'),
end
bounds = [xL xU];
fplot(func, bounds);
Risposte (1)
Rishabh Mishra
il 8 Nov 2020
Hi,
Use the code below to work out the issue you are facing.
disp('0. Graphical')
disp('1. Incremental Search')
disp('2. Bisection Method')
disp('3. False Position Method')
disp('4. Fixed Point Iteration')
disp('5. Newton Raphson')
disp('6. Secant')
disp('7. Modified Secant')
disp('__________________________________')
disp(' ')
meth = input('Select Method (0 through 7):');
switch meth
case 0
disp(' ')
disp('You been Have Selected Graphical Method')
isCorrect = 2;
while(isCorrect == 2)
isCorrect = input('if that Correct type (1) if is not correct type (2)');
end
func = input('Primary Function (@(x)):');
if isempty(func)
error('Must Enter a Function. Start again.'),
end
xL = input('Lower Interval Limit: ');
if isempty(xL)
error('Must Enter a Lower Limit. Start again. ');
end
xU = input('Upper Interval Limit: ');
if isempty(xU)
error('Must Enter an Upper limit. Start again.'),
end
bounds = [xL xU];
fplot(func, bounds);
end
Hope this helps.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!