Beruflich Dokumente
Kultur Dokumente
%OPENING ANIMATION
sound(s1,44000);
pause(0.01);
animation = javax.swing.JLabel('<html><img src="file:animo.gif"/></html>');
animation.setBackground(java.awt.Color(0,0,0));
[ani, animo] = javacomponent(animation,[]);
set(animo, 'pos', [0,0,1210,637])
pause(1);
set(h_image, 'visible','on');
set(hole, 'visible','on')
set(hole2, 'visible','on')
set(animo, 'visible','off');
obj.Volume = 100;
%%%%%%
loading1 = javax.swing.JLabel('<html><img src="file:loadinga.gif"/></html>');
loading1.setBackground(java.awt.Color(0,0,0));
[ld, ld1] = javacomponent(loading1,[]);
set(ld1,'pos', [379,181,460,276])
pause(0.7);
sound(l,44000);
Speak(obj,power);
pause(15.2);
set(ld1,'visible','off')
sound(jar,44000);
pause(0.4);
jerome = javax.swing.JLabel('<html><img src="file:core.gif"/></html>');
jerome.setBackground(java.awt.Color(0,0,0)); %=white
[hj, hc] = javacomponent(jerome,[]);
set(hc, 'pos', [539,550,114,118])
set(hc, 'visible','off')
set(hc, 'visible','on');
msg1 = javax.swing.JLabel('<html><img src="file:msg1.gif"/></html>');
msg1.setBackground(java.awt.Color(0,0,0)); %=white
[mg, hg1] = javacomponent(msg1,[]);
set(hg1, 'pos', [95,335,1044,196])
sound(sd,44000);
pause(1.4);
sound(l3,44000);
pause(0.01);
defaultString=('Hello there, Im Jarvis, Im your personal assistant for this prog
ram');
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
defaultString=('but first i would like to know your name');
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
pause(0.3);
set(hc1, 'visible','on');
set(hc, 'visible','off');
pause(1.70);
set(hc1, 'visible','off');
set(hc, 'visible','on');
pause(0.01);
sound(y,94000);
set(handles.w1,'visible','on');
pause(0.001);
set(handles.w2,'visible','on');
set(handles.w1,'visible','off');
pause(0.01);
set(handles.w3,'visible','on');
set(handles.w2,'visible','off');
pause(0.01);
set(handles.w4,'visible','on');
set(handles.w3,'visible','off');
pause(0.01);
set(handles.w4,'visible','off');
set(handles.edit1,'visible','on');
pause(2);
set(hc, 'visible','off');
set(hc1, 'visible','on');
pause(3);
set(handles.pushbutton2,'visible','on');
%
set(handles.pushbutton2,'visible','off');
set(handles.edit1,'visible','off');
set(handles.w4,'visible','on');
set(handles.w3,'visible','on');
set(handles.w2,'visible','on');
set(handles.w1,'visible','on');
pause(0.01);
set(handles.w4,'visible','off');
pause(0.01);
set(handles.w3,'visible','off');
pause(0.01);
set(handles.w2,'visible','off');
pause(0.01);
set(handles.w1,'visible','off');
set(hole, 'visible','off')
set(hole2, 'visible','off')
pause(0.01);
%CLOSE ANIMATION
sound(s1,44000);
set(h_image, 'visible','off');
pause(0.02);
animation2 = javax.swing.JLabel('<html><img src="file:animc.gif"/></html>');
animation2.setBackground(java.awt.Color(0,0,0));
[ani, animc] = javacomponent(animation2,[]);
set(animc, 'pos', [0,0,1210,637])
pause(1);
set(animc, 'visible','off');
%%%%End of Animation Close
%OPENING ANIMATION
sound(s1,44000);
pause(0.01);
animation = javax.swing.JLabel('<html><img src="file:animo.gif"/></html>');
animation.setBackground(java.awt.Color(0,0,0));
[ani, animo] = javacomponent(animation,[]);
set(animo, 'pos', [0,0,1210,637])
pause(1.10);
set(animo, 'visible','off');
set(h_image, 'visible','on');
set(hole, 'visible','on')
set(hole2, 'visible','on')
%%%%%%
set(hc, 'visible','on')
loadingsys2 = javax.swing.JLabel('<html><img src="file:loadingsys.gif"/></html>'
);
loadingsys2.setBackground(java.awt.Color(0,0,0));
pause(1);
while presignal==0;
pop=1;
pause(1);
end
if presignal==1;
set(hc, 'visible','off');
set(handles.msg5,'visible','off');
pause(0.02);
%CLOSE ANIMATION
sound(s1,44000);
set(h_image, 'visible','off');
set(hole, 'visible','off');
set(hole2, 'visible','off');
pause(0.02);
animation2 = javax.swing.JLabel('<html><img src="file:animc.gif"/></html>');
animation2.setBackground(java.awt.Color(0,0,0));
[ani, animc] = javacomponent(animation2,[]);
set(animc, 'pos', [0,0,1210,637])
pause(1);
set(animc, 'visible','off');
%%%%End of Animation Close
set(handles.msg6,'String',name);
%OPENING ANIMATION
sound(s1,44000);
pause(0.01);
animation = javax.swing.JLabel('<html><img src="file:animo.gif"/></html>');
animation.setBackground(java.awt.Color(0,0,0));
[ani, animo] = javacomponent(animation,[]);
set(animo, 'pos', [0,0,1210,637])
pause(1.10);
set(animo, 'visible','off');
set(h_image, 'visible','on');
set(hole, 'visible','on')
set(hole2, 'visible','on')
%%%%%%pause(0.5);
set(hc, 'visible','on')
pause(0.9);
name=strcat(pre,' ' , name);
set(handles.msg6,'visible','on');
set(handles.msg5,'String','Welcome');
set(handles.msg5,'visible','on');
%%%%%%
pause(0.01)
caUserInput=char(strcat('Welcome!',name));
Speak(obj, caUserInput);
set(handles.msg5,'visible','off');
set(handles.msg6,'visible','off');
pause(0.01);
roots2 = javax.swing.JLabel('<html><img src="file:rootsp.gif"/></html>');
roots2.setBackground(java.awt.Color(0,0,0)); %=white
[hj3, hc3] = javacomponent(roots2,[]);
set(hc3, 'pos', [409,480,422,58]);
roots1 = javax.swing.JLabel('<html><img src="file:roots.gif"/></html>');
roots1.setBackground(java.awt.Color(0,0,0)); %=white
[hj2, hc2] = javacomponent(roots1,[]);
set(hc2, 'pos', [409,480,422,58]);
pause(1);
set(hc2, 'visible','off')
caUserInput=char('Roots of Polynomials, ');
pause(0.001);
Speak(obj, caUserInput);
pause(1);
pause(0.01);
wel = javax.swing.JLabel('<html><img src="file:groups2.gif"/></html>');
wel.setBackground(java.awt.Color(0,0,0)); %=white
[hj4, wel] = javacomponent(wel,[]);
set(wel, 'pos', [342,50,560,379]);
pause(0.1);
caUserInput=char('This program including myself was created by Jerome S. Mananqu
il,');
Speak(obj, caUserInput);
pause(0.01)
pause(0.01)
caUserInput=char('Lygem Morales,Jason Narciso, and Nicholson Zapanta!,Submitted
to Engineer Richard Figueroa. I am here to assist you with this program');
Speak(obj, caUserInput);
pause(0.01);
pause(0.01);
set(wel, 'visible','off');
set(hc3, 'visible','off');
set(hc2, 'visible','off')%CLOSE ANIMATION
sound(s1,44000);
set(h_image, 'visible','off');
set(hole, 'visible','off');
set(hole2, 'visible','off');
pause(0.02);
animation2 = javax.swing.JLabel('<html><img src="file:animc.gif"/></html>');
animation2.setBackground(java.awt.Color(0,0,0));
[ani, animc] = javacomponent(animation2,[]);
set(animc, 'pos', [0,0,1210,637])
pause(1);
set(animc, 'visible','off');
set(hc1, 'visible','off');
set(hc, 'visible','on');
%%%%End of Animation Close;
global s2
pause(0.01)
set(handles.wipe,'visible','on');
caUserInput=char(strcat(name,'How can I help you?first I can discuss to you the
Roots of Polynomials.'));
Speak(obj, caUserInput);
sound(s2,67000);
size=8
set(handles.wipe,'position',[87,27,57,size]);
set(handles.discussion,'visible','on');
while size>1
set(handles.wipe,'position',[87,27,57,size]);
size=size-0.5;
pause(0.1);
end
pause(1);
caUserInput=char('second I can make an activity for you with the assessment prog
ram.');
Speak(obj, caUserInput);
sound(s2,67000);
size=8
set(handles.wipe,'position',[87,21,59,size]);
set(handles.assess,'visible','on');
while size>0
set(handles.wipe,'position',[87,21,59,size]);
size=size-0.5;
pause(0.1);
end
pause(1);
caUserInput=char('lastly I can help you to find the root of a polynomial');
Speak(obj, caUserInput);
sound(s2,67000);
set(handles.rootsapp,'visible','on');
size=8
set(handles.wipe,'position',[87,14,59,size]);
while size>0
set(handles.wipe,'position',[87,14,59,size]);
pause(0.1);
size=size-0.5;
end
set(handles.wipe,'visible','off');
end
% --- Executes on button press in Muller.
function Muller_Callback(hObject, eventdata, handles)
% hObject
handle to Muller (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
set(handles.both,'visible','off');
set(handles.disbairstow,'visible','off');
set(handles.dismuller,'visible','off');
set(handles.discussion,'visible','off');
set(handles.bairstow,'visible','off');
set(handles.assess,'visible','off');
set(handles.rootsapp,'visible','off');
set(handles.Muller,'visible','off');
global hc1;global h_image; global y;global hc; global s1;
global animo; global animc; global animation;global animation2;
[y,Fs]=audioread('start.wav');
sound(s1,44000);
set(hc1, 'visible','on')
%OPENING ANIMATION
sound(s1,44000);
pause(0.01);
animation = javax.swing.JLabel('<html><img src="file:animo.gif"/></html>');
animation.setBackground(java.awt.Color(0,0,0));
[ani, animo] = javacomponent(animation,[]);
set(animo, 'pos', [0,0,1210,637])
pause(1.10);
set(animo, 'visible','off');
%%%%%%pause(0.5);
set(hc1, 'visible','on');
set(hc, 'visible','off');
%%%%End of Animation Close;
pause(0.1);
set(handles.text105,'String','Muller Method');
set(h_image, 'visible','off');
set([handles.text38,handles.text39,handles.text40,handles.text41,handles.text42,
handles.text43,handles.text44,handles.text45,handles.text46,handles.text47,handl
es.text48,handles.text49,handles.text50,handles.text51,handles.text52,handles.te
xt53,handles.text54,handles.text55,handles.text56,handles.text57,handles.text58,
handles.text59,handles.text60,handles.text61,handles.text62,handles.text63,handl
es.text64,handles.text65,handles.text66,handles.text67,handles.text68,handles.te
xt69,handles.text70,handles.text71,handles.text72,handles.text73,handles.text74,
handles.text75,handles.text76,handles.text77,handles.text78,handles.text79,handl
es.text78,handles.text79,handles.text80,handles.text81,handles.text82,handles.te
xt83,handles.text84,handles.text85,handles.text86,handles.text87,handles.text88,
handles.text89,handles.text90,handles.text91,handles.text92,handles.text93,handl
es.text94,handles.text95,handles.text96,handles.text97,handles.text98,handles.te
xt99,handles.text100,handles.text101,handles.text102],'visible','on');
set([handles.func,handles.Muller,handles.xo,handles.x1,handles.x2,handles.sc,han
dles.pushbutton4,handles.text103,handles.text104,handles.text105,handles.text106
,handles.text107,handles.text108,handles.text109,handles.text110,handles.text111
],'visible','on');
set(handles.Muller,'visible','off');
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global hc1;global name; global hc;
global pre;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
func=get(handles.func,'String');
x0=str2double(get(handles.xo,'String'));
x1=str2double(get(handles.x1,'String'));
x2=str2double(get(handles.x2,'String'));
apperror=str2double(get(handles.sc,'String'));
if isempty(func)
errordlg('You must enter an equation','Jarvis')
set(hc,'visible','on'); pause(0.01);
Speak(obj,char(strcat(name,'You must enter an equation')));
set(hc,'visible','off'); set(hc1,'visible','on');
return
end
if isnan(x0)
errordlg('You must enter a numeric value of X0','Jarvis')
set(hc,'visible','on'); pause(0.01);
Speak(obj,char(strcat(name,'You must enter a numeric value of X sub zero')));
set(hc,'visible','off'); set(hc1,'visible','on');
return
end
if isnan(x1)
errordlg('You must enter a numeric value of X1','Jarvis')
set(hc,'visible','on'); pause(0.01);
Speak(obj,char(strcat(name,'You must enter a numeric value of X sub one')));
set(hc,'visible','off'); set(hc1,'visible','on');
return
end
if isnan(x2)
errordlg('You must enter a numeric value of X2','Jarvis')
set(hc,'visible','on'); pause(0.01);
Speak(obj,char(strcat(name,'You must enter a numeric value of X sub two')));
set(hc,'visible','off'); set(hc1,'visible','on');
return
end
if isnan(apperror)
errordlg('You must enter a numeric value of stopping criterion','Jarvis');
set(hc,'visible','on'); pause(0.01);
Speak(obj,char(strcat(name,'You must enter a numeric value of stopping criterio
n')));
set(hc,'visible','off'); set(hc1,'visible','on');
return
end
set(hc1, 'visible','off');
set(handles.wipe, 'visible','on');
else
x3=x2+((-2*c)/(b-sqr));
end
error=abs((x3-x2)/x3)*100;
iter=iter+1;
if iter==2
set(handles.text40,'String',x3);
set(handles.text55,'String',error);
end
if iter==3
set(handles.text41,'String',x3);
set(handles.text56,'String',error);
end
if iter==4
set(handles.text42,'String',x3);
set(handles.text57,'String',error);
end
if iter==5
set(handles.text43,'String',x3);
set(handles.text58,'String',error);
end
if iter==6
set(handles.text44,'String',x3);
set(handles.text59,'String',error);
end
if iter==7
set(handles.text45,'String',x3);
set(handles.text60,'String',error);
end
if iter==8
set(handles.text46,'String',x3);
set(handles.text61,'String',error);
end
if iter==9
set(handles.text47,'String',x3);
set(handles.text62,'String',error);
end
if iter==10
set(handles.text48,'String',x3);
set(handles.text62,'String',error);
end
end
caUserInput=('Calculation Complete')
pause(0.01);
Speak(obj, caUserInput);
size=36;
while size>1
size=size-1;
set(handles.wipe,'position',[0,0,240,size]);
pause(0.007);
end
set(handles.wipe, 'visible','off')
% --- Executes during object creation, after setting all properties.
function ani1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to ani1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
set(h_image, 'visible','on');
%%%%%%pause(0.5);
global name;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
set(handles.wipe,'visible','on');
pause(0.001);
Speak(obj,char(strcat(name,'There are two methods in getting the roots of a poly
nomials! What method would you like me to discuss? You may select The 1st metho
d which is Muller!')));
sound(s2,67000);
size=8;
set(handles.wipe,'position',[87,29.05,59,size]);
set(handles.dismuller,'visible','on');
while size>1
set(handles.wipe,'position',[87,29.05,59,size]);
size=size-0.5;
pause(0.1);
end
pause(0.001);
Speak(obj,char(strcat( 'The 2nd method is Bairstow!')));
set(handles.wipe,'position',[87,21.05,59,size]);
set(handles.disbairstow,'visible','on');
sound(s2,67000);
size=8;
while size>1
set(handles.wipe,'position',[87,21.05,59,size]);
size=size-0.5;
pause(0.1);
end
pause(0.001);
Speak(obj,char(strcat( ' Or you may choose both methods to be discussed')));
set(handles.wipe,'position',[87,14.05,59,size]);
set(handles.both,'visible','on');
sound(s2,67000);
size=8;
while size>1
set(handles.wipe,'position',[87,14.05,59,size]);
size=size-0.5;
pause(0.1);
end
set(handles.back,'visible','on');
set(handles.wipe,'visible','off');
pause(5);
set(a2,'visible','off');
pause(0.05);
dis11 = javax.swing.JLabel('<html><img src="file:a3.gif"/></html>');
dis11.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a3] = javacomponent(dis11,[]);
set(a3, 'pos', [268,445,666,84])
pause(0.05);
caUserInput = char('Because we have three equations. we can solve for the three
unknown coefficients. a. b. and c.');
pause(0.05);
Speak(obj, caUserInput);
dis12 = javax.swing.JLabel('<html><img src="file:a4.gif"/></html>');
dis12.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a4] = javacomponent(dis12,[]);
set(a4, 'pos', [259,300,685,151])
pause(0.01);
caUserInput = char('The equations are the following');
Speak(obj, caUserInput);
set(a3,'visible','off');
pause(5);
set(a4,'visible','off');
dis13 = javax.swing.JLabel('<html><img src="file:a5.gif"/></html>');
dis13.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a5] = javacomponent(dis13,[]);
set(a5, 'pos', [235,250,685,298])
pause(0.05);
caUserInput = char('Which can be solved for a, b and c. The results can be summa
rized as a is equal to delta sub one minus delta sub zero all over x sub one min
us x sub zero while b is equal to a times H sub one plus delta sub one. And c is
equal to F of x sub two ');
Speak(obj, caUserInput);
set(a5,'visible','off');
pause(2);
dis14 = javax.swing.JLabel('<html><img src="file:a6.gif"/></html>');
dis14.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a6] = javacomponent(dis14,[]);
set(a6, 'pos', [270,250,664,221])
pause(0.05);
caUserInput = char('To find the root, we apply the quadratic formula. However. b
ecause of potential round-off error. rather than using the conventional form. we
use the alternative formulation x sub 3 is equal to x sub 2 plus the quantity o
f negative two 2 C over b positive negative the square root of b squared minus 4
AC');
Speak(obj, caUserInput);
set(a6,'visible','off');
pause(3);
dis15 = javax.swing.JLabel('<html><img src="file:a7.gif"/></html>');
dis15.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a7] = javacomponent(dis15,[]);
set(a7, 'pos', [271,250,661,279])
pause(0.05);
caUserInput = char('Note that the use of the quadratic formula means that both r
eal and complex roots can be located. This is a major benefit of the method.the
error can be calculated as approximate error is equal to the absolute value of x
sub 3 minus x sub 2 all over x sub 3 multiply by 100 percent');
Speak(obj, caUserInput);
pause(7);
set(a7,'visible','off');
dis16 = javax.swing.JLabel('<html><img src="file:a8.gif"/></html>');
dis16.setBackground(java.awt.Color(0,0,0)); %black
dis18.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a10] = javacomponent(dis18,[]);
set(a10, 'pos', [217,250,768,265])
pause(0.05);
caUserInput = char('Bairstow s method is an iterative approach related loosely to
both the Muller and Newton Raphson methods. Before launching into a mathematical
description of the technique. recall the factored form of the polynomial. f of
x = a sub 0 plus a sub 1 x. plus a sub 2 x squared. plus a sub n x raised to n
');
Speak(obj, caUserInput);
set(a10,'visible','off');
dis19 = javax.swing.JLabel('<html><img src="file:a11.gif"/></html>');
dis19.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a11] = javacomponent(dis19,[]);
set(a11, 'pos', [237,145,729,378])
pause(0.05);
caUserInput = char('Can be divided by the factor x minus t to yield a second pol
ynomial that is one order lower. f of x sub n minus 1 = b sub 1 + b sub 2 x + b
sub 3 x raise to n 2 + b sub n x raise to n minus 1. with a remainder R = b0. wh
ere the coefficients can be calculated by the recurrence relationship. b sub n =
a sub n, b sub i = a sub i + b sub i + 1 raise to t for i = n negative 1 to 0 .
Note that if t were a root of the original polynomial. the remainder b sub 0 wou
ld equal zero.');
Speak(obj, caUserInput);
set(a11,'visible','off');
dis20 = javax.swing.JLabel('<html><img src="file:a12.gif"/></html>');
dis20.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a12] = javacomponent(dis20,[]);
set(a12, 'pos', [260,230,683,298])
pause(0.05);
caUserInput = char('To permit the evaluation of complex roots. Bairstow s method d
ivides the polynomial by a quadratic factor x raise to 2 minus r times x minus s
. The result is a new polynomial. f of x sub n - 2 = b sub 2 + b sub 3 x + b sub
n minus 1 x raise to n minus 3 + b sub n x raise to n minus 2. with a remainder
, r = b sub 1 multiply to the quantity of x minus r + b sub 0');
Speak(obj, caUserInput);
set(a12,'visible','off');
dis21 = javax.swing.JLabel('<html><img src="file:a13.gif"/></html>');
dis21.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a13] = javacomponent(dis21,[]);
set(a13, 'pos', [241,200,720,319])
pause(0.05);
caUserInput = char('As with normal synthetic division. a simple recurrence relat
ionship can be used to perform the division by the quadratic factor. b sub n = a
sub n. b sub n minus 1 = a sub n minus 1 + r time b sub n. b sub i = a sub i +
r times b sub i + 1 + s times b sub i + 2. for i = n negative 2 to 0. ');
Speak(obj, caUserInput);
set(a13,'visible','off');
dis22 = javax.swing.JLabel('<html><img src="file:a14.gif"/></html>');
dis22.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a14] = javacomponent(dis22,[]);
set(a14, 'pos', [238,200,726,319])
pause(0.05);
caUserInput = char('If x raise to 2 minus r times x minus s is an exact divisor
of the polynomial. complex roots can be determined by the quadratic formula. Thu
s. the method reduces to determining the values of r and s that make the quadrat
ic factor an exact divisor. In other words, we seek the values that make the rem
ainder term equal to zero. ');
Speak(obj, caUserInput);
pause(2);
set(a14,'visible','off');
dis23 = javax.swing.JLabel('<html><img src="file:a15.gif"/></html>');
dis23.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a15] = javacomponent(dis23,[]);
set(a15, 'pos', [247,150,709,382])
pause(0.05);
caUserInput = char('Bairstow s method uses a strategy similar to the Newton- Raphs
on approach. Because both b sub 0 and b sub 1 are functions of both r and s, the
y can be expanded using a Taylor series');
Speak(obj, caUserInput);
pause(5);
caUserInput = char('where the values on the right-hand side are all evaluated at
r and s');
Speak(obj, caUserInput);
set(a15,'visible','off');
dis24 = javax.swing.JLabel('<html><img src="file:a16.gif"/></html>');
dis24.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a16] = javacomponent(dis24,[]);
set(a16, 'pos', [278,200,646,318])
pause(0.05);
caUserInput = char('The changes, change of r and change of s , needed to improve
our guesses can be estimated by setting equal to zero to give');
Speak(obj, caUserInput);
pause(5);
set(a16,'visible','off');
dis25 = javax.swing.JLabel('<html><img src="file:a17.gif"/></html>');
dis25.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a17] = javacomponent(dis25,[]);
set(a17, 'pos', [254,30,695,503])
pause(0.05);
caUserInput = char('If the partial derivatives of the b s can be determined, these
are a system of two equations that can be solved simultaneously for the two unk
nowns, change of r and change of s. Bairstow showed that the partial derivatives
can be obtained by a synthetic division of the b s in a fashion similar to the wa
y in which the b s themselves were derived. c sub n = b sub n. c sub n minus 1 = b
sub n minus 1 + r time c sub n. c sub i = b sub i + r times c sub i + 1 + s tim
es c sub i + 2. for i = n negative 2 to 0.');
Speak(obj, caUserInput);
set(a17,'visible','off');
pause(3);
dis28 = javax.swing.JLabel('<html><img src="file:a18.gif"/></html>');
dis28.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a18] = javacomponent(dis28,[]);
set(a18, 'pos', [285,40,632,488])
pause(0.05);
caUserInput = char('Where');
Speak(obj, caUserInput);
pause(5);
caUserInput = char('Thus, the partial derivatives are obtained by synthetic divi
sion of the b s.');
set(a18,'visible','off');
pause(3);
% handles
structure with handles and user data (see GUIDATA)
set(handles.both,'visible','off');
set(handles.disbairstow,'visible','off');
set(handles.dismuller,'visible','off');
set(handles.discussion,'visible','off');
set(handles.bairstow,'visible','off');
set(handles.assess,'visible','off');
set(handles.rootsapp,'visible','off');
set(handles.Muller,'visible','off');
global store;
store=0
if store==0
set(handles.store,'String','1')
end
pause(0.001);
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char('You have chosen both methods to be discussed.');
Speak(obj, caUserInput);
dis1 = javax.swing.JLabel('<html><img src="file:r1.gif"/></html>');
dis1.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r1] = javacomponent(dis1,[]);
caUserInput = char('Roots of Polynomials')
set(r1, 'pos', [398,300,444,215])
pause(0.001);
Speak(obj, caUserInput);
pause(2);
set(r1,'visible','off');
dis2 = javax.swing.JLabel('<html><img src="file:r2.gif"/></html>');
dis2.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r2] = javacomponent(dis2,[]);
set(r2, 'pos', [303,350,593,181])
pause(0.05);
caUserInput = char('To find the roots of polynomial equations of the general for
m:');
Speak(obj, caUserInput);
dis3 = javax.swing.JLabel('<html><img src="file:r3.gif"/></html>');
dis3.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r3] = javacomponent(dis3,[]);
set(r3, 'pos', [216,244,771,79])
pause(0.05);
caUserInput = char('f of x is equal to a sub zero plus a sub 1 x plus a sub 2 x
squared to plus a sub n x raise to n');
Speak(obj, caUserInput);
set(r2,'visible','off');
set(r3,'visible','off');
dis4 = javax.swing.JLabel('<html><img src="file:r4.gif"/></html>');
dis4.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r4] = javacomponent(dis4,[]);
set(r4, 'pos', [191,280,820,218])
pause(0.05);
caUserInput = char('Where n = the order of the polynomial and the a s = constant c
oefficients. Although the coefficients can be complex numbers, we will limit our
discussion to cases where they are real. For such cases, the roots can be real
and or complex.');
Speak(obj, caUserInput);
set(r4,'visible','off');
dis5 = javax.swing.JLabel('<html><img src="file:r5.gif"/></html>');
dis5.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r5] = javacomponent(dis5,[]);
set(r5, 'pos', [175,350,852,154])
pause(0.05);
caUserInput = char('The roots of such polynomials follow these rules:');
Speak(obj, caUserInput);
dis6 = javax.swing.JLabel('<html><img src="file:r6.gif"/></html>');
dis6.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r6] = javacomponent(dis6,[]);
set(r6, 'pos', [237,100,729,255])
pause(0.05);
caUserInput = char('first, For an nth-order equation, there are n real or comple
x roots. It should be noted that these roots will not necessarily be distinct. s
econd, If n is odd, there is at least one real root. and third, If complex roots
exist, they exist in conjugate pairs where i is equal to negative one');
Speak(obj, caUserInput);
set(r5,'visible','off');
set(r6,'visible','off');
pause(2);
caUserInput = char('Press the Mullers Button to continue');
Speak(obj, caUserInput);
set(handles.dismuller,'visible','on');
set([handles.func,handles.Muller,handles.xo,handles.x1,handles.x2,handles.sc,han
dles.pushbutton4,handles.text103,handles.text104,handles.text105,handles.text106
,handles.text107,handles.text108,handles.text109,handles.text110,handles.text111
],'visible','off');
set([handles.bstow1,handles.bstow2,handles.bstow3,handles.bstow4,handles.bstow5,
handles.bstow6,handles.solvee,handles.text148,handles.r,handles.q,handles.es,han
dles.eq,handles.rvalues,handles.svalues,handles.quo1,handles.quo2,handles.quo3,]
,'visible','off');
set(handles.dismuller,'visible','off');
set(handles.disbairstow,'visible','off');
set(handles.Muller,'visible','off');
set(handles.bairstow,'visible','off');
set(handles.amuller,'visible','off');
set(handles.abairstow,'visible','off');
set(handles.both,'visible','off');
set(handles.back,'visible','off');
%CLOSE ANIMATION
sound(s1,44000);
set(h_image, 'visible','off');
pause(0.02);
animation2 = javax.swing.JLabel('<html><img src="file:animc.gif"/></html>');
animation2.setBackground(java.awt.Color(0,0,0));
[ani, animc] = javacomponent(animation2,[]);
set(animc, 'pos', [0,0,1210,637])
pause(1);
set(animc, 'visible','off');
set(handles.assess,'visible','on');
set(handles.rootsapp,'visible','on');
set(handles.discussion,'visible','on')
%%%%End of Animation Close
size=50
pause(1);
sound(y,67000);
while size>1
size=size-0.7;
set(handles.wipe,'position',[0,0,245,size]);
pause(0.01);
end
set(handles.wipe,'position',[0,0,240,0.1]);
%%%%%%
;
set(hc,'visible','on');
% --- Executes on button press in pushbutton16.
function pushbutton16_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
set(handles.assess,'visible','on');
set(handles.rootsapp,'visible','on');
set(handles.discussion,'visible','on');
q = get(handles.q, 'string')
es = get(handles.es, 'string')
r = str2double(r)
q = str2double(q)
es = str2double(es)
if isempty(eq)
errordlg('You must enter an equation','Jarvis')
Speak(obj,char(strcat(name,'You must enter an equation')));
return
end
if isnan(r)
errordlg('You must enter a numeric value for r','Jarvis')
Speak(obj,char(strcat(name,'You must enter a numeric value for r')));;
return
end
if isnan(q)
errordlg('You must enter a numeric value for s','Jarvis')
Speak(obj,char(strcat(name,'You must enter a numeric value for s')));;
return
end
if isnan(es)
errordlg('You must enter a numeric value for es','Jarvis')
Speak(obj,char(strcat(name,'You must enter a numeric value for stopping criteri
on')));;
return
end
hcc2 = javax.swing.JLabel('<html><img src="file:corecal.gif"/></html>');
hcc2.setBackground(java.awt.Color(0,0,0));
[ani, hc2b] = javacomponent(hcc2,[]);
set(hc2b, 'pos', [380,550,314,118])
set(hc2b, 'visible','on');
set(handles.wipe,'visible','on');
size=1;
while size<37
size=size+1;
set(handles.wipe,'position',[0,0,240,size]);
pause(0.01);
end
es = es*100
co = coeffs(eq, x)
co = fliplr(co)
n = length(co)
eas = 100
ear = 100
if n > 5
while eas & ear >= es
b(1) = co(1);
b(2)=co(n-(n-2))+(r*b(1));
%part 2
for i = 3:n
b(i)=co(i)+r*b(i-1)+q*b(i-2);
end
%part 3
c(1)=b(1);
c(2)=b(2)+(r*c(1));
%part 4
for i= 3:n-1
c(i)=b(i)+(r*c(i-1))+(q*c(i-2));
end
%part 5
syms nr ns
[solnr, solns] = solve( c(n-2)*nr + c(n-3)*ns == -b(n-1), c(n-1)*nr + c(
n-2)*ns == -b(n) );
[nr] = double(r + solnr);
[ns] = double(q + solns);
%part 6
ear = double(abs(solnr/nr))*100;
eas = double(abs(solns/ns)) *100;
r= [nr];
q= [ns];
diary output.txt
fprintf('%0.5f\n', r);
diary off
diary outputq.txt
fprintf('%0.5f\n', q);
diary off
%
%
%
%
%
qwe = sscanf(sprintf('%f',[r]),'%f')
set(handles.rvalues, 'string', qwe);
pause(0.5);
drawnow;
end
%quotient
f1 =x - (r + sqrt(r^2+(4*q)))/2;
f2 =x - (r - sqrt(r^2+(4*q)))/2;
f1 = sym2poly(f1);
f2 = sym2poly(f2);
co = double(co);
[v] = deconv(co, f1);
[v] = deconv(v, f2);
w = vpa(poly2sym(v), 5);
w = char(w)
assignin('base','w', w)
set(handles.quo1, 'string', w)
co = v;
n = length(co);
end
eas = 100;
ear = 100;
if n > 3
while eas & ear >= es
b(1) = co(1);
b(2)=co(n-(n-2))+(r*b(1));
%part 2
for i = 3:n
b(i)=co(i)+r*b(i-1)+q*b(i-2);
end
%part 3
c(1)=b(1);
c(2)=b(2)+(r*c(1));
%part 4
for i= 3:n-1
c(i)=b(i)+(r*c(i-1))+(q*c(i-2));
end
%part 5
syms nr ns
[solnr, solns] = solve( c(n-2)*nr + c(n-3)*ns == -b(n-1), c(n-1)*nr + c(
n-2)*ns == -b(n) );
[nr] = double(r + solnr);
[ns] = double(q + solns);
%part 6
ear = double(abs(solnr/nr))*100;
eas = double(abs(solns/ns)) *100;
r= [nr];
q= [ns];
diary output.txt
fprintf('%0.5f\n', r);
diary off
diary outputq.txt
fprintf('%0.5f\n', q);
diary off
%
%
%
%
%
qwe = sscanf(sprintf('%f',[r]),'%f')
set(handles.rvalues, 'string', qwe);
pause(0.5);
drawnow;
end
%quotient
f1 =x - (r + sqrt(r^2+(4*q)))/2;
f2 =x - (r - sqrt(r^2+(4*q)))/2;
f1 = sym2poly(f1);
f2 = sym2poly(f2);
co = double(co);
[v] = deconv(co, f1);
[v] = deconv(v, f2);
ww = vpa(poly2sym(v), 5);
ww = char(ww)
assignin('base','ww', ww)
set(handles.quo2, 'string', ww)
end
if n == 3
root1 =(r + sqrt(r^2+(4*q)))/2;
root2 =(r - sqrt(r^2+(4*q)))/2;
assignin('base', 'root1', root1);
assignin('base', 'root2', root2);
rtrt = strvcat(root1,root2);
set(handles.quo3, 'string', rtrt)
end
if n == 2
root1 = roots(co)
set(handles.quo3, 'string', root1)
end
if n == 1
set(handles.rvalues, 'string', '0')
end
set(hc2b, 'visible','off');
data1 = importdata('output.txt');
set(handles.rvalues, 'Max', 2)
set(handles.rvalues, 'string', data1)
data2 = importdata('outputq.txt');
set(handles.rvalues, 'Max', 2)
set(handles.svalues, 'string', data2)
delete('output.txt')
delete('outputq.txt')
set(hc,'visible','on');
caUserInput=('Calculation Complete')
pause(0.01);
Speak(obj, caUserInput);
set(hc,'visible','off');
set(hc1,'visible','on');
size=37;
while size>1
size=size-1;
set(handles.wipe,'position',[0,0,241,size]);
pause(0.01);
end
set(handles.wipe,'visible','off');
set(hObject,'BackgroundColor','white');
end
set([handles.SIR,handles.MAAM],'visible','off')
pre=('MAAM');
presignal=1;
% --- Executes on button press in SIR.
function SIR_Callback(hObject, eventdata, handles)
% hObject
handle to SIR (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of SIR
global pre;
global presignal;
set([handles. SIR,handles.MAAM],'visible','off')
pre=('Sir');
presignal=1;
% --- Executes on button press in pushbutton23.
function pushbutton23_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton23 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global pre; global presignal;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
presignal=1;
global name
%
%
%%%%%%pause(0.5);
% UIWAIT makes Assessment_Muller wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Assessment_Muller_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%OPENING ANIMATION
global y1;global h_imagee;
sound(y1,64000);
pause(0.01);
animation = javax.swing.JLabel('<html><img src="file:animo.gif"/></html>');
animation.setBackground(java.awt.Color(0,0,0));
[ani, animo] = javacomponent(animation,[]);
set(animo, 'pos', [0,0,1210,637])
pause(1.10);
set(animo, 'visible','off');
set(h_imagee, 'visible','on');
function edit1_Callback(hObject, eventdata, handles)
% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
%
str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
%
See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgr
oundColor'))
set(hObject,'BackgroundColor','white');
end
set(hObject,'BackgroundColor','white');
end
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
s.text15,'String',' ');
set(handles.text16,'String',' ');set(handles.text17,'String',' ');set(handle
s.text18,'String',' ');set(handles.text19,'String',' ');set(handles.text20,'Stri
ng',' ');
set(handles.pushbutton13,'enable','on');
end
if strcmp(gset,'Second Iteration')
set(handles.text11,'String','Third Iteration');
set(handles.pushbutton2,'visible','off');set(handles.pushbutton4,'visible','
off');set(handles.pushbutton5,'visible','off');set(handles.pushbutton6,'visible'
,'off');
set(handles.pushbutton7,'visible','off');set(handles.pushbutton8,'visible','
off');set(handles.pushbutton9,'visible','off');set(handles.pushbutton10,'visible
','off');
set(handles.pushbutton11,'visible','off');set(handles.edit2,'visible','off')
;set(handles.edit3,'visible','off');set(handles.edit4,'visible','off');
set(handles.edit5,'visible','off');set(handles.edit6,'visible','off');set(ha
ndles.edit7,'visible','off');set(handles.edit8,'visible','off');
set(handles.edit9,'visible','off');set(handles.text13,'visible','off');set(h
andles.text14,'visible','off');set(handles.text15,'visible','off');set(handles.t
ext16,'visible','off');
set(handles.text17,'visible','off');set(handles.text18,'visible','off');set(
handles.text19,'visible','off');set(handles.text20,'visible','off');
set(handles.text3,'visible','off');set(handles.text4,'visible','off');set(ha
ndles.text5,'visible','off');set(handles.text6,'visible','off');
set(handles.text7,'visible','off');set(handles.text8,'visible','off');set(ha
ndles.text9,'visible','off');set(handles.text10,'visible','off');
set(handles.edit1,'enable','on');set(handles.edit2,'enable','on');set(handle
s.edit3,'enable','on');
set(handles.edit4,'enable','on');set(handles.edit5,'enable','on');set(handle
s.edit6,'enable','on');set(handles.edit8,'enable','on');set(handles.edit7,'enabl
e','on');
set(handles.pushbutton13,'String','3 Hints left');
set(handles.edit2,'String','1'); set(handles.edit3,'String','1');set(handles
.edit4,'String','1');set(handles.edit5,'String','1');
set(handles.edit6,'String','1');set(handles.edit7,'String','1');set(handles.
edit8,'String','1');set(handles.edit9,'String','1');
set(handles.text13,'String',' ');set(handles.text14,'String',' ');set(handle
s.text15,'String',' ');
set(handles.pushbutton13,'enable','on');
set(handles.text16,'String',' ');set(handles.text17,'String',' ');set(handle
s.text18,'String',' ');set(handles.text19,'String',' ');set(handles.text20,'Stri
ng',' ');
end
if strcmp(gset,'Third Iteration')
set(handles.text11,'String','Fourth Iteration');
set(handles.pushbutton2,'visible','off');set(handles.pushbutton4,'visible','
off');set(handles.pushbutton5,'visible','off');set(handles.pushbutton6,'visible'
,'off');
set(handles.pushbutton7,'visible','off');set(handles.pushbutton8,'visible','
off');set(handles.pushbutton9,'visible','off');set(handles.pushbutton10,'visible
','off');
set(handles.pushbutton11,'visible','off');set(handles.edit2,'visible','off')
;set(handles.edit3,'visible','off');set(handles.edit4,'visible','off');
set(handles.edit5,'visible','off');set(handles.edit6,'visible','off');set(ha
ndles.edit7,'visible','off');set(handles.edit8,'visible','off');
set(handles.edit9,'visible','off');set(handles.text13,'visible','off');set(h
andles.text14,'visible','off');set(handles.text15,'visible','off');set(handles.t
ext16,'visible','off');
set(handles.text17,'visible','off');set(handles.text18,'visible','off');set(
handles.text19,'visible','off');set(handles.text20,'visible','off');
set(handles.text3,'visible','off');set(handles.text4,'visible','off');set(ha
ndles.text5,'visible','off');set(handles.text6,'visible','off');
set(handles.text7,'visible','off');set(handles.text8,'visible','off');set(ha
ndles.text9,'visible','off');set(handles.text10,'visible','off');
set(handles.edit1,'enable','on');set(handles.edit2,'enable','on');set(handle
s.edit3,'enable','on');
set(handles.edit4,'enable','on');set(handles.edit5,'enable','on');set(handle
s.edit6,'enable','on');set(handles.edit8,'enable','on');set(handles.edit7,'enabl
e','on');
set(handles.pushbutton13,'String','3 Hints left');
set(handles.edit2,'String','1'); set(handles.edit3,'String','1');set(handles
.edit4,'String','1');set(handles.edit5,'String','1');
set(handles.edit6,'String','1');set(handles.edit7,'String','1');set(handles.
edit8,'String','1');set(handles.edit9,'String','1');
set(handles.text13,'String',' ');set(handles.text14,'String',' ');set(handle
s.text15,'String',' ');
set(handles.text16,'String',' ');set(handles.text17,'String',' ');set(handle
s.text18,'String',' ');set(handles.text19,'String',' ');set(handles.text20,'Stri
ng',' ');
set(handles.pushbutton13,'enable','on');
end
if strcmp(pset,'Finish')
answer = questdlg('Are you sure?','FINISH','Yes','No','Yes')
switch answer
case 'Yes'
quit
case 'No'
return
end
end
set(handles.text12,'String',' ');
set(handles.edit1,'String',' ');
set(handles.text14,'String','Correct');
set(handles.text15,'visible','on');
set(handles.edit4,'visible','on');
set(handles.text5,'visible','on');
set(handles.edit3,'enable','off');
set(handles.pushbutton6,'visible','on');
set(handles.edit4,'String',' ');
else
set(handles.text14,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(s0)
set(handles.text14,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
if (abs(34.722-s0)/34.722)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text14,'String','Correct');
set(handles.text15,'visible','on');
set(handles.edit4,'visible','on');
set(handles.text5,'visible','on');
set(handles.edit3,'enable','off');
set(handles.pushbutton6,'visible','on');
set(handles.edit4,'String',' ');
else
set(handles.text14,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(s0)
set(handles.text14,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end
set(handles.text16,'visible','on');
set(handles.edit5,'visible','on');
set(handles.text6,'visible','on');
set(handles.edit4,'enable','off');
set(handles.pushbutton11,'visible','on');
set(handles.edit5,'String',' ');
else
set(handles.text15,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(s1)
set(handles.text15,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Second Iteration'
if (abs(47.695-s1)/47.695)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text15,'String','Correct');
set(handles.text16,'visible','on');
set(handles.edit5,'visible','on');
set(handles.text6,'visible','on');
set(handles.edit4,'enable','off');
set(handles.pushbutton11,'visible','on');
set(handles.edit5,'String',' ');
else
set(handles.text15,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(s1)
set(handles.text15,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Third Iteration'
if (abs(34.722-s1)/34.722)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text15,'String','Correct');
set(handles.text16,'visible','on');
set(handles.edit5,'visible','on');
set(handles.text6,'visible','on');
set(handles.edit4,'enable','off');
set(handles.pushbutton11,'visible','on');
set(handles.edit5,'String',' ');
else
set(handles.text15,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(s1)
set(handles.text15,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
if (abs(35.004-s1)/35.004)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text15,'String','Correct');
set(handles.text16,'visible','on');
set(handles.edit5,'visible','on');
set(handles.text6,'visible','on');
set(handles.edit4,'enable','off');
set(handles.pushbutton11,'visible','on');
set(handles.edit5,'String',' ');
else
set(handles.text15,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(s1)
set(handles.text15,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end
set(handles.edit8,'visible','on');
set(handles.text9,'visible','on');
set(handles.edit7,'enable','off');
set(handles.pushbutton8,'visible','on');
set(handles.edit8,'String',' ');
else
set(handles.text18,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(c)
set(handles.text18,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Third Iteration'
if (abs((0.012-c)/0.012))*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text18,'String','Correct');
set(handles.text19,'visible','on');
set(handles.edit8,'visible','on');
set(handles.text9,'visible','on');
set(handles.edit7,'enable','off');
set(handles.pushbutton8,'visible','on');
set(handles.edit8,'String',' ');
else
set(handles.text18,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(c)
set(handles.text18,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
if (abs((0-c)/0.00001))*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text18,'String','Correct');
set(handles.text19,'visible','on');
set(handles.edit8,'visible','on');
set(handles.text9,'visible','on');
set(handles.edit7,'enable','off');
set(handles.pushbutton8,'visible','on');
set(handles.edit8,'String',' ');
else
set(handles.text18,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(c)
set(handles.text18,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end
else
set(handles.text19,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(x3)
set(handles.text19,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
if (abs((4-x3)/4))*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text19,'String','Correct');
set(handles.text20,'visible','on');
set(handles.edit9,'visible','on');
set(handles.text10,'visible','on');
set(handles.edit8,'enable','off');
set(handles.pushbutton9,'visible','on');
set(handles.edit9,'String',' ');
else
set(handles.text19,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(x3)
set(handles.text19,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end
end
if isnan(ea)
set(handles.text20,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end
end
case 'Third Iteration'
if (abs((35.032-b)/35.032))*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text17,'String','Correct');
set(handles.text18,'visible','on');
set(handles.edit7,'visible','on');
set(handles.text8,'visible','on');
set(handles.edit6,'enable','off');
set(handles.pushbutton7,'visible','on');
set(handles.edit7,'String',' ');
else
set(handles.text17,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(b)
set(handles.text17,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
if (abs((35-b)/35))*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text17,'String','Correct');
set(handles.text18,'visible','on');
set(handles.edit7,'visible','on');
set(handles.text8,'visible','on');
set(handles.edit6,'enable','off');
set(handles.pushbutton7,'visible','on');
set(handles.edit7,'String',' ');
else
set(handles.text17,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(b)
set(handles.text17,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end
set(handles.text16,'String','Correct');
set(handles.text17,'visible','on');
set(handles.edit6,'visible','on');
set(handles.text7,'visible','on');
set(handles.edit5,'enable','off');
set(handles.pushbutton10,'visible','on');
set(handles.edit6,'String',' ');
else
set(handles.text16,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(a)
set(handles.text16,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Second Iteration'
if (abs(13.476-a)/13.476)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text16,'String','Correct');
set(handles.text17,'visible','on');
set(handles.edit6,'visible','on');
set(handles.text7,'visible','on');
set(handles.edit5,'enable','off');
set(handles.pushbutton10,'visible','on');
set(handles.edit6,'String',' ');
else
set(handles.text16,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(a)
set(handles.text16,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Third Iteration'
if (abs(12.977-a)/12.977)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text16,'String','Correct');
set(handles.text17,'visible','on');
set(handles.edit6,'visible','on');
set(handles.text7,'visible','on');
set(handles.edit5,'enable','off');
set(handles.pushbutton10,'visible','on');
set(handles.edit6,'String',' ');
else
set(handles.text16,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(a)
set(handles.text16,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
Speak(obj,char('Your answer is Correct'));
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if strcmp(p13,'1 Hint left')
set(handles.pushbutton13,'String','0 Hint left');
if strcmp(g1,'Incorrect') || isnan(h0)
msgbox('The correct answer is between 0 and 3','HINT')
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between -1 and 1','HINT');
end
if isnan(s1) || strcmp(g4,'Incorrect');
msgbox('The correct answer is between 60 and 70','HINT');
end
if isnan(s0) || strcmp(g3,'Incorrect')
msgbox('The correct answer is between 60 and 70','HINT')
end
if isnan(a) || strcmp(g5,'Incorrect')
msgbox('The correct answer is between 10 and 20','HINT')
end
if isnan(b) || strcmp(g6,'Incorrect')
msgbox('The correct answer is between 60 and 70','HINT')
end
if isnan(c) || strcmp(g7,'Incorrect')
msgbox('The correct answer is between 40 and 50','HINT')
end
if isnan(x3) || strcmp(g8,'Incorrect')
msgbox('The correct answer is between 1 and 5','HINT')
end
if isnan(ea) || strcmp(g9,'Incorrect')
msgbox('The correct answer is between 20 and 30','HINT')
end
end
if strcmp(p13,'0 Hint left')
msgbox('Im sorry. You ran out of hints','HINT');
end
case 'Second Iteration'
if strcmp(p13,'3 Hints left')
set(handles.pushbutton13,'String','2 Hints left');
if strcmp(g1,'Incorrect') || isnan(h0)
msgbox('The correct answer is between -1 and 1','HINT')
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between -2 and 0','HINT');
end
if isnan(s1) || strcmp(g4,'Incorrect');
msgbox('The correct answer is between 40 and 50','HINT');
end
if isnan(s0) || strcmp(g3,'Incorrect')
msgbox('The correct answer is between 50 and 60','HINT')
end
if isnan(a) || strcmp(g5,'Incorrect')
msgbox('The correct answer is between 10 and 20','HINT')
end
if isnan(b) || strcmp(g6,'Incorrect')
msgbox('The correct answer is between 30 and 40','HINT')
end
if isnan(c) || strcmp(g7,'Incorrect')
Hint left');
-1 and 1','HINT')
-2 and 0','HINT');
40 and 50','HINT');
50 and 60','HINT')
10 and 20','HINT')
30 and 40','HINT')
end
if isnan(c) || strcmp(g7,'Incorrect')
msgbox('The correct answer is between -2 and 0','HINT')
end
if isnan(x3) || strcmp(g8,'Incorrect')
msgbox('The correct answer is between 3 and 5','HINT')
end
if isnan(ea) || strcmp(g9,'Incorrect')
msgbox('The correct answer is between 0 and 2','HINT')
end
end
if strcmp(p13,'0 Hint left')
msgbox('Im sorry. You ran out of hints','HINT');
end
case 'Third Iteration'
if strcmp(p13,'3 Hints left')
set(handles.pushbutton13,'String','2 Hints left');
if strcmp(g1,'Incorrect') || isnan(h0)
msgbox('The correct answer is between -2 and 0','HINT')
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between 0 and 2','HINT');
end
if isnan(s1) || strcmp(g4,'Incorrect');
msgbox('The correct answer is between 30 and 40','HINT');
end
if isnan(s0) || strcmp(g3,'Incorrect')
msgbox('The correct answer is between 40 and 50','HINT')
end
if isnan(a) || strcmp(g5,'Incorrect')
msgbox('The correct answer is between 10 and 20','HINT')
end
if isnan(b) || strcmp(g6,'Incorrect')
msgbox('The correct answer is between 30 and 40','HINT')
end
if isnan(c) || strcmp(g7,'Incorrect')
msgbox('The correct answer is between 0 and 2','HINT')
end
if isnan(x3) || strcmp(g8,'Incorrect')
msgbox('The correct answer is between 3 and 5','HINT')
end
if isnan(ea) || strcmp(g9,'Incorrect')
msgbox('The correct answer is between 0 and 2','HINT')
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if strcmp(p13,'2 Hints left')
set(handles.pushbutton13,'String','1 Hint left');
if strcmp(g1,'Incorrect') || isnan(h0)
msgbox('The correct answer is between -2 and 0','HINT')
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between 0 and 2','HINT');
end
if isnan(s1) || strcmp(g4,'Incorrect');
msgbox('The correct answer is between 30 and 40','HINT');
end
if isnan(s0) || strcmp(g3,'Incorrect')
msgbox('The correct answer is between
end
if isnan(a) || strcmp(g5,'Incorrect')
msgbox('The correct answer is between
end
if isnan(b) || strcmp(g6,'Incorrect')
msgbox('The correct answer is between
end
if isnan(c) || strcmp(g7,'Incorrect')
msgbox('The correct answer is between
end
if isnan(x3) || strcmp(g8,'Incorrect')
msgbox('The correct answer is between
end
if isnan(ea) || strcmp(g9,'Incorrect')
msgbox('The correct answer is between
end
end
40 and 50','HINT')
10 and 20','HINT')
30 and 40','HINT')
0 and 2','HINT')
3 and 5','HINT')
0 and 2','HINT')
obj.Volume = 100;
Speak(obj,char('Problem Statement: Use Mullers Method with guesses of x sub zero
, x sub one, and x sub two equal to 4.5, 5.5, and 5 respectively. to determine
a root of the equation f of x is equal to x cube minus 13 x minus 12. You may st
art now'));
set([handles.text1,handles.text2,handles.text12,handles.text11,handles.edit1,han
dles.pushbutton3,handles.pushbutton13,handles.pushbutton15], 'visible','on');
% --- Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
%CLOSE ANIMATION
global y1; global h_imagee;
sound(y1,44000);
pause(0.02);
animation2 = javax.swing.JLabel('<html><img src="file:animc.gif"/></html>');
animation2.setBackground(java.awt.Color(0,0,0));
[ani, animc] = javacomponent(animation2,[]);
set(animc, 'pos', [0,0,1210,637])
pause(0.8);
close
%%%%End of Animation Close
function varargout = Assessment_Bairstow(varargin)
% ASSESSMENT_BAIRSTOW MATLAB code for Assessment_Bairstow.fig
%
ASSESSMENT_BAIRSTOW, by itself, creates a new ASSESSMENT_BAIRSTOW or rais
es the existing
%
singleton*.
%
%
H = ASSESSMENT_BAIRSTOW returns the handle to a new ASSESSMENT_BAIRSTOW o
r the handle to
%
the existing singleton*.
%
%
ASSESSMENT_BAIRSTOW('CALLBACK',hObject,eventData,handles,...) calls the l
ocal
%
function named CALLBACK in ASSESSMENT_BAIRSTOW.M with the given input arg
uments.
%
%
ASSESSMENT_BAIRSTOW('Property','Value',...) creates a new ASSESSMENT_BAIR
STOW or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before Assessment_Bairstow_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to Assessment_Bairstow_OpeningFcn via vararg
in.
%
%
*See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
%
instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Assessment_Bairstow
% Last Modified by GUIDE v2.5 11-Mar-2015 20:09:50
% handles
else
set(handles.text9,'visible','on');
set(handles.text9,'String','Incorrect');
end
if isnan(c5)
set(handles.text9,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text9,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
if strcmp(textset,'r = -0.6442');
switch b5c5
case 'b5:'
b5=str2double(get(handles.edit1,'String'));
if (abs((1-b5)/1)*100)<=0.05
set(handles.text9,'visible','on');
set(handles.text9,'String','Correct');
set(handles.edit1,'enable','off')
set(handles.pushbutton1,'enable','off') ;
else
set(handles.text9,'visible','on');
set(handles.text9,'String','Incorrect');
end
if isnan(b5)
set(handles.text9,'visible','off');
set(handles.text10,'String','Incorrect');
end
if isnan(b4)
set(handles.text10,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text10,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
case 'c4:'
c4=str2double(get(handles.edit2,'String'));
if (abs((-5.5-c4)/-5.5)*100)<=0.05
set(handles.text10,'visible','on');
set(handles.text10,'String','Correct');
set(handles.edit2,'enable','off')
set(handles.pushbutton2,'enable','off') ;
set(handles.text5,'visible','on');
set(handles.text5,'String','c3:');
set(handles.edit3,'visible','on');
set(handles.pushbutton3,'visible','on') ;
else
set(handles.text10,'visible','on');
set(handles.text10,'String','Incorrect');
end
if isnan(c4)
set(handles.text10,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text10,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
if strcmp(textset,'r = -0.6442');
switch b4c4
case 'b4:'
b4=str2double(get(handles.edit2,'String'));
if (abs((-4.1442-b4)/-4.1442)*100)<=0.05
set(handles.text10,'visible','on');
set(handles.text10,'String','Correct');
set(handles.edit2,'enable','off')
set(handles.pushbutton2,'enable','off') ;
else
set(handles.text10,'visible','on');
set(handles.text10,'String','Incorrect');
end
if isnan(b4)
set(handles.text10,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text10,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
case 'c4:'
c4=str2double(get(handles.edit2,'String'));
if (abs((-4.7884-c4)/-4.7884)*100)<=0.05
set(handles.text10,'visible','on');
set(handles.text10,'String','Correct');
set(handles.edit2,'enable','off')
set(handles.pushbutton2,'enable','off') ;
else
set(handles.text10,'visible','on');
set(handles.text10,'String','Incorrect');
end
if isnan(c4)
set(handles.text10,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text10,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
set(handles.text11,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text11,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
case 'c3:'
c3=str2double(get(handles.edit3,'String'));
if (abs((10.75-c3)/10.75)*100)<=0.05
set(handles.text11,'visible','on');
set(handles.text11,'String','Correct');
set(handles.edit3,'enable','off')
set(handles.pushbutton3,'enable','off') ;
set(handles.text6,'visible','on');
set(handles.edit4,'visible','on');
set(handles.pushbutton4,'visible','on') ;
set(handles.text6,'String','c2:');
else
set(handles.text11,'visible','on');
set(handles.text11,'String','Incorrect');
end
if isnan(c3)
set(handles.text11,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text11,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
if strcmp(textset,'r = -0.6442');
switch b3c3
case 'b3:'
b3=str2double(get(handles.edit3,'String'));
if (abs((5.5578-b3)/5.5578)*100)<=0.05
set(handles.text11,'visible','on');
set(handles.text11,'String','Correct');
set(handles.edit3,'enable','off')
set(handles.pushbutton3,'enable','off') ;
else
set(handles.text11,'visible','on');
set(handles.text11,'String','Incorrect');
end
if isnan(b3)
set(handles.text11,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text11,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
case 'c3:'
c3=str2double(get(handles.edit3,'String'));
if (abs((8.7806-c3)/8.7806)*100)<=0.05
set(handles.text11,'visible','on');
set(handles.text11,'String','Correct');
set(handles.edit3,'enable','off')
set(handles.pushbutton3,'enable','off') ;
else
set(handles.text11,'visible','on');
set(handles.text11,'String','Incorrect');
end
if isnan(c3)
set(handles.text11,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text11,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
');
end
case 'c2:'
c2=str2double(get(handles.edit4,'String'));
if (abs((-4.875-c2)/-4.875)*100)<=0.05
set(handles.text12,'visible','on');
set(handles.text12,'String','Correct');
set(handles.edit4,'enable','off')
set(handles.pushbutton4,'enable','off') ;
set(handles.text7,'visible','on');
set(handles.edit5,'visible','on');
set(handles.pushbutton5,'visible','on');
set(handles.text7,'String','c1:');
else
set(handles.text12,'visible','on');
set(handles.text12,'String','Incorrect');
end
if isnan(c2)
set(handles.text12,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text12,'String','
');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
if strcmp(textset,'r = -0.6442');
switch b2c2
case 'b2:'
b2=str2double(get(handles.edit4,'String'));
if (abs((-2.0276-b2)/-2.0276)*100)<=0.05
set(handles.text12,'visible','on');
set(handles.text12,'String','Correct');
set(handles.edit4,'enable','off')
set(handles.pushbutton4,'enable','off') ;
else
set(handles.text12,'visible','on');
set(handles.text12,'String','Incorrect');
end
if isnan(b2)
set(handles.text12,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text12,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
case 'c2:'
c2=str2double(get(handles.edit4,'String'));
if (abs((-8.3454-c2)/-8.3454)*100)<=0.05
set(handles.text12,'visible','on');
set(handles.text12,'String','Correct');
set(handles.edit4,'enable','off')
set(handles.pushbutton4,'enable','off') ;
else
set(handles.text12,'visible','on');
set(handles.text12,'String','Incorrect');
end
if isnan(c2)
set(handles.text12,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text12,'String',' ');
defaultString = ('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
else
set(handles.text13,'visible','on');
set(handles.text13,'String','Incorrect');
end
if isnan(c1)
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text13,'visible','off');
set(handles.text13,'String','
');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
end
if strcmp(textset,'r = -0.6442');
switch b1c1
case 'b1:'
b1=str2double(get(handles.edit5,'String'));
if (abs((-1.8013-b1)/-1.8013)*100)<=0.05
set(handles.text13,'visible','on');
set(handles.text13,'String','Correct');
set(handles.edit5,'enable','off')
set(handles.pushbutton5,'enable','off') ;
else
set(handles.text13,'visible','on');
set(handles.text13,'String','Incorrect');
end
if isnan(b1)
set(handles.text13,'visible','off');
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
if strcmp(textset,'r = -0.6442');
b0=str2double(get(handles.edit6,'String'));
if (abs((2.1304-b0)/2.1304)*100)<=0.05
set(handles.text14,'visible','on');
set(handles.text14,'String','Correct');
set(handles.edit6,'enable','off')
set(handles.pushbutton6,'enable','off');
set(handles.pushbutton13,'visible','on');
else
set(handles.text14,'visible','on');
set(handles.text14,'String','Incorrect');
end
if isnan(b0)
set(handles.text14,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text14,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
% hObject
handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
text20=get(handles.text20,'String');
text21=get(handles.text21,'String');
c2=-4.875; c3=10.75;b1=-10.5; b0=11.375; c1=-16.375;
c22=-8.3454;c32=8.7806;b12=-1.8013;b02=2.1304;c12=4.7874;
e7=str2double(get(handles.edit7,'String'));
e8=str2double(get(handles.edit8,'String'));
e9=str2double(get(handles.edit9,'String'));
e10=str2double(get(handles.edit10,'String'));
e11=str2double(get(handles.edit11,'String'));
e12=str2double(get(handles.edit12,'String'));
p7=get(handles.pushbutton7,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
if ((((abs((c1-e7)/c1)*100) <=0.05) && ((abs((c2-e8)/c2)*100)<=0.05) && ((abs((b0-e9)/-b0)*100) <=0.05)) || (((abs((c2-e7)/c2)*100)<=0.05) && ((abs((c3-e8)/c3)
*100)<=0.05) && ((abs((-b1-e9)/-b1))<=0.05))) && ((e7 ~= e10) || (e8 ~= e11) ||
(e9 ~= e12))
set(handles.text20,'visible','on')
set(handles.text20,'String','Correct')
set(handles.pushbutton7,'enable','off');
set(handles.pushbutton7,'String','Next');
set(handles.pushbutton8,'enable','on');
set(handles.text20,'visible','on');
else
set(handles.text20,'visible','on')
set(handles.text20,'String','Incorrect')
end
if isnan(e7) || isnan(e8) || isnan(e9)
set(handles.text20,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text20,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
if strcmp(p7,'Next')
set(handles.text23,'visible','on');
pause(0.5)
set(handles.radiobutton2,'visible','on');
pause(0.5)
set(handles.radiobutton3,'visible','on');
pause(0.5)
set(handles.radiobutton4,'visible','on');
pause(0.5)
set(handles.radiobutton5,'visible','on');
pause(0.5)
set(handles.pushbutton9,'visible','on');
end
end
if strcmp(textset,'r = -0.6442')
if ((((abs((c12-e7)/c12)*100) <=0.05) && ((abs((c22-e8)/c22)*100)<=0.05) && ((ab
if strcmp(textset,'r = -1 ')
if ((((abs((c1-e10)/c1)*100) <=0.05) && ((abs((c2-e11)/c2)*100)<=0.05) && ((abs(
(-b0-e12)/-b0)*100) <=0.05)) || (((abs((c2-e10)/c2)*100)<=0.05) && ((abs((c3-e11
)/c3)*100)<=0.05) && ((abs((-b1-e12)/-b1))<=0.05))) && ((e7 ~= e10) || (e8 ~= e1
1) || (e9 ~= e12))
set(handles.text21,'String','Correct')
set(handles.pushbutton8,'enable','off')
set(handles.pushbutton7,'enable','on')
set(handles.pushbutton8,'String','Next')
set(handles.text21,'visible','on');
else
set(handles.text21,'visible','on');
set(handles.text21,'String','Incorrect')
end
if strcmp(p8,'Next')
set(handles.text23,'visible','on');
pause(0.5)
set(handles.radiobutton2,'visible','on');
pause(0.5)
set(handles.radiobutton3,'visible','on');
pause(0.5)
set(handles.radiobutton4,'visible','on');
pause(0.5)
set(handles.radiobutton5,'visible','on');
pause(0.5)
set(handles.pushbutton9,'visible','on');
end
if isnan(e10) || isnan(e11) || isnan(e12)
set(handles.text21,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text21,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
if strcmp(textset,'r = -0.6442')
if ((((abs((c12-e10)/c12)*100) <=0.05) && ((abs((c22-e11)/c22)*100)<=0.05) && ((
abs((-b02-e12)/-b02)*100) <=0.05)) || (((abs((c22-e10)/c22)*100)<=0.05) && ((abs
((c32-e11)/c32)*100)<=0.05) && ((abs((-b12-e12)/-b12))<=0.05))) && ((e7 ~= e10)
|| (e8 ~= e11) || (e9 ~= e12))
set(handles.text21,'String','Correct')
set(handles.text21,'visible','on')
set(handles.pushbutton8,'enable','off');
set(handles.pushbutton8,'String','Next');
set(handles.pushbutton7,'enable','on');
set(handles.radiobutton2,'String','a.0.2346,-0.6341');
set(handles.radiobutton3,'String','b.0.1331,0.3316');
set(handles.radiobutton4,'String','c.3.1415,1.618');
set(handles.radiobutton5,'String','d.2.1015,-2.1304');
else
set(handles.text21,'String','Incorrect')
end
if isnan(e10) || isnan(e11) || isnan(e12)
errordlg('Avoid entering non-numeric values','JARVIS');
set(handles.text21,'String',' ');
defaultString=('Avoid entering non-numeric values')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
if strcmp(p8,'Next')
set(handles.text23,'visible','on');
pause(0.5)
set(handles.radiobutton2,'visible','on');
pause(0.5)
set(handles.radiobutton3,'visible','on');
pause(0.5)
set(handles.radiobutton4,'visible','on');
pause(0.5)
set(handles.radiobutton5,'visible','on');
pause(0.5)
set(handles.pushbutton9,'visible','on');
end
end
c=get(handles.radiobutton4,'value')
d=get(handles.radiobutton5,'value')
text24=get(handles.text24,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
if a == 1;
set(handles.text24,'visible','on');
set(handles.text24,'String','Correct');
set(handles.pushbutton9,'String','Next');
set(handles.radiobutton2,'enable','off');
set(handles.radiobutton3,'enable','off');
set(handles.radiobutton4,'enable','off');
set(handles.radiobutton5,'enable','off');
if strcmp(text24,'Correct')
set(handles.text28,'visible','on');
pause(0.5)
set(handles.radiobutton6,'visible','on');
pause(0.5)
set(handles.radiobutton7,'visible','on');
pause(0.5)
set(handles.radiobutton8,'visible','on');
pause(0.5)
set(handles.radiobutton9,'visible','on');
pause(0.5)
set(handles.pushbutton10,'visible','on');
end
else
set(handles.text24,'visible','on');
set(handles.text24,'String','Incorrect');
end
if (a == 0) && (b == 0) && (c == 0) && (d == 0)
errordlg('Pick your answer first','ERROR');
set(handles.text24,'visible','off');
set(handles.text24,'String',' ');
defaultString=('Pick your answer first')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
if strcmp(textset,'r = -0.6442')
if b == 1;
set(handles.text24,'visible','on');
set(handles.text24,'String','Correct');
set(handles.pushbutton9,'String','Next');
set(handles.radiobutton2,'enable','off');
set(handles.radiobutton3,'enable','off');
set(handles.radiobutton4,'enable','off');
set(handles.radiobutton5,'enable','off');
if strcmp(text24,'Correct')
set(handles.text28,'visible','on');
pause(0.5)
set(handles.radiobutton6,'visible','on');set(handles.radiobutton6,'String','
a.3.1415,1.618');
pause(0.5)
set(handles.radiobutton7,'visible','on');set(handles.radiobutton7,'String','
b.-0.550,-1.315');
pause(0.5)
set(handles.radiobutton8,'visible','on');set(handles.radiobutton8,'String','
c.-0.589 ,-1.315');
pause(0.5)
set(handles.radiobutton9,'visible','on');set(handles.radiobutton9,'String','
d.-0.5111 ,0.4697');
pause(0.5)
set(handles.pushbutton10,'visible','on');
end
else
set(handles.text24,'visible','on');
set(handles.text24,'String','Incorrect');
end
if (a == 0) && (b == 0) && (c == 0) && (d == 0)
errordlg('Pick your answer first','JARVIS');
set(handles.text24,'visible','off');
set(handles.text24,'String',' ');
defaultString=('Pick your answer first')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
% handles
b=get(handles.radiobutton7,'value')
c=get(handles.radiobutton8,'value')
d=get(handles.radiobutton9,'value')
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
if c == 1;
set(handles.text29,'visible','on');
set(handles.text29,'String','Correct');
set(handles.pushbutton10,'String','Next');
set(handles.radiobutton6,'enable','off');
set(handles.radiobutton7,'enable','off');
set(handles.radiobutton8,'enable','off');
set(handles.radiobutton9,'enable','off');
else
set(handles.text29,'visible','on');
set(handles.text29,'String','Incorrect');
end
if (a == 0) && (b == 0) && (c == 0) && (d == 0)
errordlg('Pick your answer first','JARVIS');
set(handles.text29,'visible','off');
set(handles.text29,'String',' ');
defaultString=('Pick your answer first')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
if strcmp(p10,'Next')
msgbox('The approximate error of r and s are 55.23-percent and 824.1-percent, re
spectively. The numbers do not fall within the prescribed stopping criterion','J
ARVIS');
defaultString=('The approximate error of r and s are 55.23 percent and 824.1 per
cent, respectively. The numbers do not fall within the prescribed stopping crite
rion. We can now move on to the second iteration with the improved r and s.')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
pause(1)
set(handles.text25,'String','r = -0.6442')
set(handles.text26,'String','s = 0.1318');
set(handles.text15,'visible','off');set(handles.text16,'visible','off');set(
handles.text17,'visible','off');set(handles.text18,'visible','off');
set(handles.text19,'visible','off');set(handles.text23,'visible','off');set(
handles.text28,'visible','off');
set(handles.edit7,'visible','off'); set(handles.edit8,'visible','off'); set(
handles.edit9,'visible','off');set(handles.pushbutton7,'visible','off');set(hand
les.pushbutton10,'visible','off');
set(handles.edit10,'visible','off'); set(handles.edit11,'visible','off'); se
t(handles.edit12,'visible','off'); set(handles.pushbutton8,'visible','off');
set(handles.pushbutton9,'visible','off');set(handles.radiobutton2,'visible',
'off');set(handles.radiobutton3,'visible','off');set(handles.radiobutton4,'visib
le','off');
set(handles.radiobutton5,'visible','off');set(handles.radiobutton6,'visible'
,'off');set(handles.radiobutton7,'visible','off');set(handles.radiobutton8,'visi
ble','off');
set(handles.text20,'String',' ');set(handles.text21,'String',' ');set(handle
s.text24,'String',' ');set(handles.text29,'String',' ');set(handles.radiobutton9
,'visible','off');
set(handles.edit7,'String',' ');set(handles.edit8,'String',' ');set(handles.
edit9,'String',' ');set(handles.edit10,'String',' ');
set(handles.edit11,'String',' ');set(handles.edit12,'String',' ');
set(handles.text32,'String','Second iteration');set(handles.text20,'visible'
,'off');set(handles.text21,'visible','off');set(handles.text24,'visible','off');
set(handles.text29,'visible','off');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set(handles.text9,'visible','off');set(handles.text10,'visible','off');set(h
andles.text11,'visible','off');
set(handles.text12,'visible','off');set(handles.text13,'visible','off');set(
handles.text14,'visible','off');
set(handles.text9,'String',' ');set(handles.text10,'String',' ');set(handles
.text11,'String',' ');set(handles.text12,'String',' ')
set(handles.text14,'String',' ');set(handles.text13,'String',' ');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set(handles.text3,'String','b5:');set(handles.edit1,'enable','on');set(handl
es.pushbutton1,'enable','on');
set(handles.edit1,'String',' ');
pause(0.5);
set(handles.text4,'String','b4:');set(handles.edit2,'enable','on');set(handl
es.pushbutton2,'enable','on')
set(handles.edit2,'String',' ');
pause(0.5);
set(handles.text5,'String','b3:');set(handles.edit3,'enable','on');set(handl
es.pushbutton3,'enable','on');
set(handles.edit3,'String',' ');
pause(0.5);
set(handles.text6,'String','b2:');set(handles.edit4,'enable','on');set(handl
es.pushbutton4,'enable','on');
set(handles.edit4,'String',' ');
pause(0.5);
set(handles.text7,'String','b1:');set(handles.edit5,'enable','on');set(handl
es.pushbutton5,'enable','on');
set(handles.edit5,'String',' ');
pause(0.5);
set(handles.text8,'String','b0:');set(handles.edit6,'enable','on');set(handl
es.pushbutton6,'enable','on');
set(handles.edit6,'String',' ');
set(handles.pushbutton6,'visible','on');set(handles.text8,'visible','on');se
t(handles.edit6,'visible','on');
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if strcmp(textset,'r = -0.6442')
if d == 1;
set(handles.text29,'visible','on');
set(handles.text29,'String','Correct');
set(handles.pushbutton10,'String','Next');
msgbox('The approximate error of r and s are 26-percent and 70.6-percent, re
spectively. Still, they do not fall within the prescribed stopping criterion','J
ARVIS');
pause(0.1);
defaultString=('The approximate error of r and s are 26-percent and 70.6-per
cent, respectively. Still, they do not fall within the prescribed stopping crite
rion')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
pause(2);
set(handles.text30,'visible','on');set(handles.text31,'visible','on');set(han
dles.text32,'visible','off');
pause(0.1);
defaultString=('After four iterations, the method converges on the values of
r equal to negative 0.5 and s equal to 0.5. What are the values of the first two
roots? ')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
pause(1);
defaultString1=('a. 1 and 2')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString1); % Convert from cell to string.
Speak(obj, caUserInput);
set(handles.radiobutton10,'visible','on');
pause(0.5)
defaultString2=('b. two and negative four')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString2); % Convert from cell to string.
Speak(obj, caUserInput);
set(handles.radiobutton12,'visible','on');
pause(0.5)
defaultString3=('c. 0.3 and negative 0.6')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString3); % Convert from cell to string.
Speak(obj, caUserInput);
set(handles.radiobutton11,'visible','on');
pause(0.5)
defaultString2=('b. 0.5 and negative one')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString2); % Convert from cell to string.
Speak(obj, caUserInput);
set(handles.radiobutton13,'visible','on');
pause(0.5)
set(handles.pushbutton14,'visible','on');
else
set(handles.text29,'visible','on');
set(handles.text29,'String','Incorrect');
end
if (a == 0) && (b == 0) && (c == 0) && (d == 0)
errordlg('Pick your answer first','JARVIS');
set(handles.text29,'String',' ');
defaultString=('Pick your answer first')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
end
xt11,'String');
g4=get(handles.text12,'String');g5=get(handles.text13,'String');
if strcmp(g1,'Correct') && strcmp(g2,'Correct') && strcmp(g3,'Correct') && strcm
p(g4,'Correct') && strcmp(g5,'Correct')
set(handles.pushbutton13,'visible','off');
set(handles.text3,'String','c5:');set(handles.edit1,'String',' ');set(handles.ed
it1,'enable','on');set(handles.text9,'String',' ');
set(handles.text9,'visible','off');
set(handles.pushbutton1,'enable','on');
pause(0.5)
set(handles.text4,'String','c4:');set(handles.edit2,'String',' ');set(handles.ed
it2,'enable','on');set(handles.text10,'String',' ');
set(handles.pushbutton2,'enable','on');set(handles.text10,'visible','off');
pause(0.5)
set(handles.text5,'String','c3:');set(handles.edit3,'String',' ');set(handles.ed
it3,'enable','on');set(handles.text11,'String',' ');
set(handles.pushbutton3,'enable','on');set(handles.text11,'visible','off');
pause(0.5)
set(handles.text6,'String','c2:');set(handles.edit4,'String',' ');set(handles.ed
it4,'enable','on');set(handles.text12,'String',' ');
set(handles.pushbutton4,'enable','on');set(handles.text12,'visible','off');
pause(0.5)
set(handles.text7,'String','c1:');set(handles.edit5,'String',' ');set(handles.ed
it5,'enable','on');set(handles.text13,'String',' ');
set(handles.pushbutton5,'enable','on');set(handles.text13,'visible','off');
pause(0.5)
set(handles.text8,'visible','off');set(handles.edit6,'visible','off');set(handle
s.text14,'visible','off');
set(handles.pushbutton6,'visible','off');set(handles.text14,'visible','off');
else
msgbox('Please answer all the requirements first','JARVIS');
defaultString=('Please answer all the requirements first')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
% --- Executes on button press in radiobutton10.
function radiobutton10_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton10
e=get(handles.radiobutton10,'value');
f=get(handles.radiobutton11,'value');
g=get(handles.radiobutton12,'value');
h=get(handles.radiobutton13,'value');
if e == 1;
set(handles.radiobutton11,'value',0);
set(handles.radiobutton12,'value',0);
set(handles.radiobutton13,'value',0);
end
% hObject
handle to pushbutton14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
e=get(handles.radiobutton10,'value');
f=get(handles.radiobutton11,'value');
g=get(handles.radiobutton12,'value');
h=get(handles.radiobutton13,'value');
if e == 0 && f == 0 && g == 0 && h == 0;
errordlg('Pick your answer first','JARVIS')
end
if h == 1;
msgbox('You can now exit by pressing FINISH','JARVIS');
msgbox('Success! You have completed the assessment test!','JARVIS');
set(handles.pushbutton18,'visible','on');
set(handles.pushbutton14,'visible','off');
pause(0.1);
defaultString=('Success! You have completed the assessment test. You can now ex
it by pressing FINISH' )
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
else
msgbox('Incorrect. Try again','JARVIS');
pause(0.1);
defaultString=('Incorrect. Try again' )
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
end
quit
case 'No'
return
end
% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over pushbutton8.
function pushbutton8_ButtonDownFcn(hObject, eventdata, handles)
% hObject
handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)