Sie sind auf Seite 1von 103

function varargout = jarvis(varargin)

% JARVIS MATLAB code for jarvis.fig


%
JARVIS, by itself, creates a new JARVIS or raises the existing
%
singleton*.
%
%
H = JARVIS returns the handle to a new JARVIS or the handle to
%
the existing singleton*.
%
%
JARVIS('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in JARVIS.M with the given input arguments.
%
%
JARVIS('Property','Value',...) creates a new JARVIS or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before jarvis_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to jarvis_OpeningFcn via varargin.
%
%
*See GUI Options on GUIDE'q 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 jarvis
% Last Modified by GUIDE v2.5 08-Mar-2015 17:43:02
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @jarvis_OpeningFcn, ...
'gui_OutputFcn', @jarvis_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before jarvis is made visible.
function jarvis_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% varargin command line arguments to jarvis (see VARARGIN)
% Choose default command line output for jarvis
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);

global jar; global hole;global hole2;


global hg; global y; global l; global hc1 ;global jerome1; global jerome;
global hj1; global hj; global l2; global s1;global s2;global y3;
global sd; global l3;
set(handles.edit1,'visible','off');
set(handles.pushbutton2,'visible','off');
set(handles.pushbutton1,'visible','on');
[y,Fs]=audioread('start.wav');
[sd,Fs]=audioread('Audio.wma');
[s1,Fs]=audioread('soundeffect1.wma');
[s2,Fs]=audioread('soundeffect2.wma');
[s3,Fs]=audioread('soundeffect2.wma');
[y3,Fs]=audioread('trans.wma');
[jar,Fs]=audioread('jar.wav');
[l,Fs]=audioread('loadinga.mp3');
[l2,Fs]=audioread('loading.wav');
[l3,Fs]=audioread('soundeffectload2.wma');
global h_image;

h_LogoAxis = axes('units','pixels','position', [0,0,1210,637]);


h_image = image(imread(['ani.png']));
set(h_image, 'visible','off')
set(h_LogoAxis, 'Visible','off');

jerome1 = javax.swing.JLabel('<html><img src="file:corepause.png"/></html>');


jerome1.setBackground(java.awt.Color(0,0,0)); %=white
[hj1, hc1] = javacomponent(jerome1,[]);
set(hc1, 'pos', [539,550,114,118])
set(hc1, 'visible','off')
holes = javax.swing.JLabel('<html><img src="file:holes.gif"/></html>');
holes.setBackground(java.awt.Color(0,0,0)); %=white
[hj1, hole] = javacomponent(holes,[]);
set(hole, 'pos', [135,611,75,17])
set(hole, 'pos', [135,611,75,17])
holes2 = javax.swing.JLabel('<html><img src="file:holes.gif"/></html>');
holes2.setBackground(java.awt.Color(0,0,0));
[hj1, hole2] = javacomponent(holes2,[]);
set(hole2, 'pos', [1010,615,75,17])
set(hole, 'visible','off')
set(hole2, 'visible','off')

% UIWAIT makes jarvis wait for user response (see UIRESUME)


% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = jarvis_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;

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 doubl
e

% --- 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
% --- 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)
global hg; global hg1;global y; global l; global hc; global hc1 ;global jerome1;
global jerome;
global hj1; global hj; global sd;global l3;
global jar; global hole; global hole2
global animo; global animc; global animation;global animation2; global ani;
global h_image;global s1; global s2;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
set(handles.pushbutton1,'visible','off');
power=char('Powering the system 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);
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');

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global hg; global hc1 ; global hg1; global hole; global hole2
global hc; global y; global h_image; global jar;
global animo; global animc; global animation;global animation2;
global name;global s1; global l3
global presignal; global pre; global sd;
presignal=0;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
name=get(handles.edit1,'String');
if isempty(name);
errordlg('Sorry you cannot proceed until you enter your name','Jarvis')
set(hc,'visible','on'); pause(0.01);

Speak(obj,char(strcat(name,'Sorry you cannot proceed until you enter your name'


)));
pause(0.3);
set(hc,'visible','off'); set(hc1,'visible','on');
return
end
set(hg1, 'visible','off');
set(hc1, 'visible','off');

%
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));

[ani, loadingsys] = javacomponent(loadingsys2,[]);


set(loadingsys, 'pos', [170,280,846,182])
pause(0.001);
sound(l3,44000);
Speak(obj, char('beginning systems check'));
pause(3);
set(loadingsys, 'visible','off');
pause(1);
sound(sd,44000);
hr=str2double(datestr(now,'HH'));
if hr>=12
date=datestr(now,'mmmm dd yyyy HH:MMPM')
set(handles.msg5,'String','TODAY IS');
set(handles.msg5,'visible','on');
set(handles.msg7,'String',date);
set(handles.msg7,'visible','on');
end
if hr<12
date=datestr(now,'mmmm dd yyyy HH:MMAM')
set(handles.msg5,'visible','on');
set(handles.msg5,'String','TODAY is');
set(handles.msg7,'String',date);
set(handles.msg7,'visible','on');
end
pause(0.5);
Speak(obj, char(strcat('Today is',date)));
set(handles.msg7,'visible','off');
set(handles.msg5,'visible','off');
pause(1);

set(handles.msg5,'String','Lets get started');


set(handles.msg5,'visible','on');
pause(0.01);
Speak(obj, char('Lets get started!'));
cau=strcat('Your name is!',name);
caUserInput=char(cau);
set(handles.msg6,'visible','on');
pause(0.01);
presignal=0;
set(handles.msg7,'String',name);
set(handles.msg7,'visible','on');
pause(0.01);
Speak(obj, caUserInput);
pause(0.01);
set(handles.msg6,'visible','off');
set(handles.msg5,'String','Please indicate if you would like to be refer as MAAM
or SIR?');
set(handles.msg7,'visible','off');
pause(0.01);
Speak(obj, char('Please indicate if you would like to be refer as MAAM or SIR?')
);
set([handles.MAAM,handles.SIR], 'visible','on');

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');

function xo_Callback(hObject, eventdata, handles)


% hObject
handle to xo (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 xo as text
%
str2double(get(hObject,'String')) returns contents of xo as a double

% --- Executes during object creation, after setting all properties.


function xo_CreateFcn(hObject, eventdata, handles)
% hObject
handle to xo (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

function x1_Callback(~, eventdata, handles)


% hObject
handle to x1 (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 x1 as text
%
str2double(get(hObject,'String')) returns contents of x1 as a double
% --- Executes during object creation, after setting all properties.
function x1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to x1 (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

function x2_Callback(hObject, eventdata, handles)


% hObject
handle to x2 (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 x2 as text
%
str2double(get(hObject,'String')) returns contents of x2 as a double
% --- Executes during object creation, after setting all properties.
function x2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to x2 (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
% --- 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');

hcc2 = javax.swing.JLabel('<html><img src="file:corecal.gif"/></html>');


hcc2.setBackground(java.awt.Color(0,0,0));
[ani, hc2] = javacomponent(hcc2,[]);
set(hc2, 'pos', [380,550,314,118])
set(hc2, 'visible','on');
syms x ;
pause(0.01);
size=1;
while size<36
size=size+1;
set(handles.wipe,'position',[0,0,240,size]);
pause(0.01);
end
defaultString = strcat(pre,'Please wait Im calculating your data');
caUserInput = char(defaultString); % Convert from cell to string.
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, caUserInput);
pause(0.3);
set(hc2, 'visible','off');
set(hc1, 'visible','on')
h0=x1-x0;
h1=x2-x1;
p0=double(subs(func,x,x1)-subs(func,x,x0))/(x1-x0);
p1=double(subs(func,x,x2)-subs(func,x,x1))/(x2-x1);
a=double((p1-p0)/(h1+h0));
b=double((a*h1)+p1);
c=double(subs(func,x,x2));
sqr=double(sqrt(b^2-4*a*c));
set(handles.text38,'String',x2);
set(handles.text53,'String','--');
if b+sqr > b-sqr
x3=x2+(-2*c/(b+sqr));
else
x3=x2+((-2*c)/(b-sqr));
end
error=abs((x3-x2)/x3)*100;
set(handles.text54,'String',error);
set(handles.text39,'String',x3);
iter=1;
while iter<=30 && apperror<=error
x0=x1;x1=x2;x2=x3;
h0=x1-x0;h1=x2-x1;
p0=double(subs(func,x,x1)-subs(func,x,x0))/(x1-x0);
p1=double(subs(func,x,x2)-subs(func,x,x1))/(x2-x1);
a=double((p1-p0)/(h1+h0));
b=double((a*h1)+p1);
c=double(subs(func,x,x2));
sqr=double(sqrt(b^2-4*a*c));
if b+sqr > b-sqr
x3=x2+(-2*c/(b+sqr));

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

empty - handles not created until after all CreateFcns called

% --- Executes during object creation, after setting all properties.


function msg1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to msg1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes during object creation, after setting all properties.
function w1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to w1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes during object creation, after setting all properties.
function msg5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to msg5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes during object creation, after setting all properties.
function text30_CreateFcn(hObject, eventdata, handles)
% hObject
handle to text30 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes during object creation, after setting all properties.
function text31_CreateFcn(hObject, eventdata, handles)
% hObject
handle to text31 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called

% --- Executes during object creation, after setting all properties.


function Roots_CreateFcn(hObject, eventdata, handles)
% hObject
handle to Roots (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
function sc_Callback(hObject, eventdata, handles)
% hObject
handle to sc (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 sc as text
%
str2double(get(hObject,'String')) returns contents of sc as a double
% --- Executes during object creation, after setting all properties.
function sc_CreateFcn(hObject, eventdata, handles)
% hObject
handle to sc (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

function func_Callback(hObject, eventdata, handles)


% hObject
handle to func (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 func as text
%
str2double(get(hObject,'String')) returns contents of func as a double
% --- Executes during object creation, after setting all properties.
function func_CreateFcn(hObject, eventdata, handles)
% hObject
handle to func (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

% --- Executes on button press in discussion.


function discussion_Callback(hObject, eventdata, handles)
% hObject
handle to discussion (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global s1; global h_image; global s2;
%OPENING ANIMATION
set(handles.assess,'visible','off');
set(handles.rootsapp,'visible','off');
set(handles.discussion,'visible','off');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, char('Accessing Discussion Interface'));
pause(0.001);
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');
%%%%%%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');

% --- Executes on button press in assess.


function assess_Callback(hObject, eventdata, handles)
% hObject
handle to assess (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

global s1; global h_image;


NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, char('Accessing Assessment Program'));
set(handles.assess,'visible','off');
set(handles.rootsapp,'visible','off');
set(handles.discussion,'visible','off');
pause(0.001);
%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');
%%%%%%pause(0.5);
set(handles.amuller,'visible','on');
set(handles.abairstow,'visible','on');
pause(1);
set(handles.back,'visible','on');
% --- Executes on button press in rootsapp.
function rootsapp_Callback(hObject, eventdata, handles)
% hObject
handle to rootsapp (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global s1; global h_image;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, char('Accessing Roots Application'));
set(handles.assess,'visible','off');
set(handles.rootsapp,'visible','off');
set(handles.discussion,'visible','off');
%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');
%%%%%%pause(0.5);
set(handles.Muller,'visible','on');
set(handles.bairstow,'visible','on');
set(handles.back,'visible','on');

% --- Executes on button press in bairstow.


function bairstow_Callback(hObject, eventdata, handles)
% hObject
handle to bairstow (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global s1; global h_image;
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(handles.text105,'visible','on');
set(handles.text105,'String','Bairstow Method');
set([handles.Muller,handles.bairstow],'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','on');
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton1 (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 radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton2 (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 radiobutton2
% --- Executes on button press in dismuller.
function dismuller_Callback(hObject, eventdata, handles)
% hObject
handle to dismuller (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global name; global store;
set(handles.both,'visible','off');
set(handles.back,'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');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;

dis7 = javax.swing.JLabel('<html><img src="file:r7.gif"/></html>');


dis7.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r7] = javacomponent(dis7,[]);
set(r7, 'pos', [340,345,523,122])
pause(0.05);
caUserInput = char(strcat(name,'You have chosen Muller s Method'));
Speak(obj, caUserInput);
set(r7,'visible','off');
dis8 = javax.swing.JLabel('<html><img src="file:r8.gif"/></html>');
dis8.setBackground(java.awt.Color(0,0,0)); %black
[hj1, r8] = javacomponent(dis8,[]);
set(r8, 'pos', [242,60,664,466])
pause(0.05);
caUserInput = char('Muller s method takes a similar approach, but projects a parab
ola through three points. The method consists of deriving the coefficients of th
e parabola that goes through the three points. These coefficients can then be su
bstituted into the quadratic formula to obtain the point where the parabola inte
rcepts the x axis that is, the root estimate. The approach is facilitated by writi
ng the parabolic equation in a convenient form, f two of x is equal to a multipl
y to the quantity of x minus x sub two squared plus b multiply to the quantity o
f x minus x sub two plus c');
Speak(obj, caUserInput);
set(r8,'visible','off');
dis9 = javax.swing.JLabel('<html><img src="file:a1.gif"/></html>');
dis9.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a1] = javacomponent(dis9,[]);
set(a1, 'pos', [250,375,703,112])
pause(0.05);
caUserInput = char('The coefficients of equation above can be evaluated by subst
ituting each of the three points to give');
Speak(obj, caUserInput);
set(a1,'visible','off');
dis10 = javax.swing.JLabel('<html><img src="file:a2.gif"/></html>');
dis10.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a2] = javacomponent(dis10,[]);
set(a2, 'pos', [379,150,444,327])
pause(3);
caUserInput = char(strcat(name,'Shown in the graph that as the iteration increas
es. the root estimate is getting closer to the actual root'))
Speak(obj, caUserInput);

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

[hj1, a8] = javacomponent(dis16,[]);


set(a8, 'pos', [261,80,681,451])
pause(0.05);
caUserInput = char('Once x sub 3 is determined. the process is repeated. This br
ings up the issue of which point is discarded. Two general strategies are typica
lly used: first, If only real roots are being located, we choose the two origina
l points that are nearest the new root estimate, x sub 3. second, If both real a
nd complex roots are being evaluated, a sequential approach is employed.That is,
just like the secant method, x sub 1, x sub 2, and x sub 3 take the place of x
sub 0, x sub 1, and x sub 2.');
Speak(obj, caUserInput);
set(a8,'visible','off');
pause(2);
caUserInput = char(strcat(name,'Now We are done discussing the Mullers Method' )
);
Speak(obj, caUserInput);
store=str2double(get(handles.store,'String'));
if store==1
set(handles.disbairstow,'visible','on');
else if store==0
set(handles.back,'visible','on');
set(handles.disbairstow,'visible','on');
set(handles.dismuller,'visible','on');
set(handles.both,'visible','on');
end
end

% --- Executes on button press in disbairstow.


function disbairstow_Callback(hObject, eventdata, handles)
% hObject
handle to disbairstow (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global name; global pre;
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');
caUserInput = char('Roots of Polynomials'); % Convert from cell to string.
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
dis17 = javax.swing.JLabel('<html><img src="file:a9.gif"/></html>');
dis17.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a9] = javacomponent(dis17,[]);
set(a9, 'pos', [287,345,628,103])
pause(0.05);
caUserInput = char(strcat(name,'You have chosen Bairstow s Method'));
Speak(obj, caUserInput);
set(a9,'visible','off');
dis18 = javax.swing.JLabel('<html><img src="file:a10.gif"/></html>');

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);

dis29 = javax.swing.JLabel('<html><img src="file:a19.gif"/></html>');


dis29.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a19] = javacomponent(dis29,[]);
set(a19, 'pos', [272,200,658,322])
pause(0.05);
caUserInput = char('Then the partial derivatives can be substituted and yield');
Speak(obj, caUserInput);
pause(5);
caUserInput = char('These equations can be solved for change of r and change of
s, which can in turn be employed to improve the initial guesses of r and s.');
Speak(obj, caUserInput);
set(a19,'visible','off');
pause(3);
dis30 = javax.swing.JLabel('<html><img src="file:a20.gif"/></html>');
dis30.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a20] = javacomponent(dis30,[]);
set(a20, 'pos', [254,250,695,274])
pause(0.05);
caUserInput = char('At each step, an approximate error in r and s can be estimat
ed, as in');
Speak(obj, caUserInput);
set(a20,'visible','off');
dis31 = javax.swing.JLabel('<html><img src="file:a21.gif"/></html>');
dis31.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a21] = javacomponent(dis31,[]);
set(a21, 'pos', [253,270,695,204])
pause(0.05);
caUserInput = char('When both of these error estimates fall below a prespecified
stopping criterion change of s, the values of the roots can be determined by');
Speak(obj, caUserInput);
set(a21,'visible','off');
dis32 = javax.swing.JLabel('<html><img src="file:a22.gif"/></html>');
dis32.setBackground(java.awt.Color(0,0,0)); %black
[hj1, a22] = javacomponent(dis32,[]);
set(a22, 'pos', [206,90,791,416]);
pause(0.05);
caUserInput = char('At this point, three possibilities exist. first, The quotien
t is a third-order polynomial or greater. For this case, Bairstow s method would b
e applied to the quotient to evaluate new values for r and s. The previous value
s of r and s can serve as the starting guesses for this application. second, The
quotient is a quadratic. and third, The quotient is a first-order polynomial. F
or this case, the remaining single root can be evaluated simply as x = s divided
by r');
Speak(obj, caUserInput);
pause(2);
set(a22,'visible','off');
pause(0.01);
caUserInput = char(strcat(name,'Now We are done discussing the Bairstows Method'
));
Speak(obj, caUserInput);
set(handles.dismuller,'visible','on');
set(handles.disbairstow,'visible','on');
set(handles.back,'visible','on');
% --- Executes on button press in both.
function both_Callback(hObject, eventdata, handles)
% hObject
handle to both (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 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');

% --- Executes on button press in amuller.


function amuller_Callback(hObject, eventdata, handles)
% hObject
handle to amuller (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global name;global h_image; global hc;
set(h_image,'visible','off');
set(hc,'visible','on');
set(handles.back,'visible','off');
set(handles.assess,'visible','on');
set(handles.rootsapp,'visible','on');
set(handles.discussion,'visible','on');
run Assessment_Muller
set(handles.amuller,'visible','off');
set(handles.abairstow,'visible','off');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, char('Muller'));
pause(1);
Speak(obj, char(strcat(name,'If you are ready just press the start button')));

% --- Executes on button press in abairstow.


function abairstow_Callback(hObject, eventdata, handles)
% hObject
handle to abairstow (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global name;global h_image; global hc;
set(h_image,'visible','off');
set(hc,'visible','on');
set(handles.back,'visible','off');
set(handles.assess,'visible','on');
set(handles.rootsapp,'visible','on');
set(handles.discussion,'visible','on');
run Assessment_Bairstow
set(handles.amuller,'visible','off');
set(handles.abairstow,'visible','off');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, char('Bairstow'));
pause(1);
Speak(obj, char(strcat(name,'If you are ready just press the start button')));
% --- Executes on button press in back.
function back_Callback(hObject, eventdata, handles)
% hObject
handle to back (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
global s1;global h_image;global y3; global y; global hc;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, char('Returning to Home Menu'));
size=0;
set(handles.wipe, 'visible','on')
sound(y3,44000);
while size<50
size=size+1.25;
set(handles.wipe,'position',[0,0,245,size]);
pause(0.01);
end
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','off');

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');

function edit13_Callback(hObject, eventdata, handles)


% hObject
handle to edit13 (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 edit13 as text
%
str2double(get(hObject,'String')) returns contents of edit13 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit13_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit13 (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

function eq_Callback(hObject, eventdata, handles)


% hObject
handle to eq (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 eq as text
%
str2double(get(hObject,'String')) returns contents of eq as a double
% --- Executes during object creation, after setting all properties.
function eq_CreateFcn(hObject, eventdata, handles)
% hObject
handle to eq (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
% --- Executes on button press in solvee.
function solvee_Callback(hObject, eventdata, handles)
% hObject
handle to solvee (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 name; global hc1; global hc;
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
syms x
eq = get(handles.eq, 'string')
r = get(handles.r, 'string')

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

defaultString = strcat(pre,'Please wait Im calculating your data');


caUserInput = char(defaultString); % Convert from cell to string.
pause(0.01);
Speak(obj, caUserInput);

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');

function r_Callback(hObject, eventdata, handles)


% hObject
handle to r (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 r as text
%
str2double(get(hObject,'String')) returns contents of r as a double
% --- Executes during object creation, after setting all properties.
function r_CreateFcn(hObject, eventdata, handles)
% hObject
handle to r (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

function q_Callback(hObject, eventdata, handles)


% hObject
handle to q (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 q as text
%
str2double(get(hObject,'String')) returns contents of q as a double
% --- Executes during object creation, after setting all properties.
function q_CreateFcn(hObject, eventdata, handles)
% hObject
handle to q (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

function es_Callback(hObject, eventdata, handles)


% hObject
handle to es (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 es as text
%
str2double(get(hObject,'String')) returns contents of es as a double
% --- Executes during object creation, after setting all properties.
function es_CreateFcn(hObject, eventdata, handles)
% hObject
handle to es (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
% --- Executes on button press in MAAM.
function MAAM_Callback(hObject, eventdata, handles)
% hObject
handle to MAAM (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 MAAM
global pre; global presignal;

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

function varargout = Assessment_Muller(varargin)


% ASSESSMENT_MULLER MATLAB code for Assessment_Muller.fig
%
ASSESSMENT_MULLER, by itself, creates a new ASSESSMENT_MULLER or raises t
he existing
%
singleton*.
%
%
H = ASSESSMENT_MULLER returns the handle to a new ASSESSMENT_MULLER or th
e handle to
%
the existing singleton*.
%
%
ASSESSMENT_MULLER('CALLBACK',hObject,eventData,handles,...) calls the loc
al
%
function named CALLBACK in ASSESSMENT_MULLER.M with the given input argum
ents.

%
%

ASSESSMENT_MULLER('Property','Value',...) creates a new ASSESSMENT_MULLER


or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before Assessment_Muller_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to Assessment_Muller_OpeningFcn via varargin
.
%
%
*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_Muller
% Last Modified by GUIDE v2.5 09-Mar-2015 22:15:57
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Assessment_Muller_OpeningFcn, ...
'gui_OutputFcn', @Assessment_Muller_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Assessment_Muller is made visible.
function Assessment_Muller_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% varargin command line arguments to Assessment_Muller (see VARARGIN)
% Choose default command line output for Assessment_Muller
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
global y1;global h_imagee;
h_LogoAxis = axes('units','pixels','position', [0,0,1210,637]);
h_imagee = image(imread(['ani.png']));
set(h_imagee, 'visible','off')
set(h_LogoAxis, 'Visible','off');
[y1,Fs]=audioread('soundeffect1.wma');

%%%%%%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

function edit2_Callback(hObject, eventdata, handles)


% hObject
handle to edit2 (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 edit2 as text
%
str2double(get(hObject,'String')) returns contents of edit2 as a double

% --- Executes during object creation, after setting all properties.


function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (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

function edit3_Callback(hObject, eventdata, handles)


% hObject
handle to edit3 (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 edit3 as text
%
str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (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

function edit4_Callback(hObject, eventdata, handles)


% hObject
handle to edit4 (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 edit4 as text
%
str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit4 (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

function edit5_Callback(hObject, eventdata, handles)


% hObject
handle to edit5 (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 edit5 as text
%
str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit5 (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

function edit6_Callback(hObject, eventdata, handles)


% hObject
handle to edit6 (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 edit6 as text
%
str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit6 (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

function edit7_Callback(hObject, eventdata, handles)


% hObject
handle to edit7 (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 edit7 as text
%
str2double(get(hObject,'String')) returns contents of edit7 as a double

% --- Executes during object creation, after setting all properties.


function edit7_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit7 (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

function edit8_Callback(hObject, eventdata, handles)


% hObject
handle to edit8 (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 edit8 as text
%
str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (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

function edit9_Callback(hObject, eventdata, handles)


% hObject
handle to edit9 (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 edit9 as text
%
str2double(get(hObject,'String')) returns contents of edit9 as a double
% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit9 (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
% --- 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)

% --- Executes during object creation, after setting all properties.


function text12_CreateFcn(hObject, eventdata, handles)
% hObject
handle to text12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
gset=get(handles.text11,'String');
pset=get(handles.pushbutton2,'String');
if strcmp(gset,'First Iteration')
set(handles.text11,'String','Second Iteration');set(handles.edit1,'enable','
on');set(handles.edit2,'enable','on');set(handles.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.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.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.pushbutton13,'String','3 Hints left');
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(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',' ');

% --- Executes during object creation, after setting all properties.


function figure1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
gset=get(handles.text11,'String');
h0=str2double(get(handles.edit1,'String'));
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs(1-h0)/1)*100 <= 0.05
set(handles.text12,'String','Correct');

Speak(obj,char('Your answer is Correct'));


set(handles.text13,'visible','on');
set(handles.edit2,'visible','on');
set(handles.text3,'visible','on');
set(handles.edit1,'enable','off');
set(handles.pushbutton4,'visible','on');
set(handles.edit2,'String',' ');
else
set(handles.text12,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h0)
set(handles.text12,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
case 'Second Iteration'
if (abs((-0.5-h0)/-0.5))*100 <= 0.05
set(handles.text12,'String','Correct');
Speak(obj,char('Your answer is Correct'));
set(handles.text13,'visible','on');
set(handles.edit2,'visible','on');
set(handles.text3,'visible','on');
set(handles.edit1,'enable','off');
set(handles.pushbutton4,'visible','on');
set(handles.edit2,'String',' ');
else
set(handles.text12,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h0)
set(handles.text12,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
case 'Third Iteration'
if (abs(-1.024-h0)/-1.024)*100 <= 0.05
set(handles.text12,'String','Correct');
Speak(obj,char('Your answer is Correct'));
set(handles.text13,'visible','on');
set(handles.edit2,'visible','on');
set(handles.text3,'visible','on');
set(handles.edit1,'enable','off');
set(handles.pushbutton4,'visible','on');
set(handles.edit2,'String',' ');
else
set(handles.text12,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h0)
set(handles.text12,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
case 'Fourth Iteration'

if (abs(0.024-h0)/0.024)*100 <= 0.05


set(handles.text12,'String','Correct');
Speak(obj,char('Your answer is Correct'));
set(handles.text13,'visible','on');
set(handles.edit2,'visible','on');
set(handles.text3,'visible','on');
set(handles.edit1,'enable','off');
set(handles.pushbutton4,'visible','on');
set(handles.edit2,'String',' ');
else
set(handles.text12,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h0)
set(handles.text12,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
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)
gset=get(handles.text11,'String');
h1=str2double(get(handles.edit2,'String'));
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((-0.5-h1)/-0.5))*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text13,'String','Correct');
set(handles.text14,'visible','on');
set(handles.edit3,'visible','on');
set(handles.text4,'visible','on');
set(handles.edit2,'enable','off');
set(handles.pushbutton5,'visible','on');
set(handles.edit3,'String',' ');
else
set(handles.text13,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h1)
set(handles.text13,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
case 'Second Iteration'

if (abs((-1.024-h1)/-1.024))*100 <= 0.05


Speak(obj,char('Your answer is Correct'));
set(handles.text13,'String','Correct');
set(handles.text14,'visible','on');
set(handles.edit3,'visible','on');
set(handles.text4,'visible','on');
set(handles.edit2,'enable','off');
set(handles.pushbutton5,'visible','on');
set(handles.edit3,'String',' ');
else
set(handles.text13,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h1)
set(handles.text13,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
case 'Third Iteration'
if (abs(0.024-h1)/0.024)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text13,'String','Correct');
set(handles.text14,'visible','on');
set(handles.edit3,'visible','on');
set(handles.text4,'visible','on');
set(handles.edit2,'enable','off');
set(handles.pushbutton5,'visible','on');
set(handles.edit3,'String',' ');
else
set(handles.text13,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h1)
set(handles.text13,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
case 'Fourth Iteration'
if (abs(0-h1)/0.00001)*100 <= 0.05
Speak(obj,char('Your answer is Correct'));
set(handles.text13,'String','Correct');
set(handles.text14,'visible','on');
set(handles.edit3,'visible','on');
set(handles.text4,'visible','on');
set(handles.edit2,'enable','off');
set(handles.pushbutton5,'visible','on');
set(handles.edit3,'String',' ');
else
set(handles.text13,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(h1)
set(handles.text13,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
Speak(obj,char('Error Avoid entering non-numeric values'));
end
end

% --- Executes on button press in pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
s0=str2double(get(handles.edit3,'String'));
gset=get(handles.text11,'String');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((62.25-s0)/62.25))*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
case 'Second Iteration'
if (abs(54.750-s0)/54.750)*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
case 'Third Iteration'
if (abs(47.695-s0)/47.695)*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
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

% --- Executes on button press in pushbutton6.


function pushbutton6_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
s1=str2double(get(handles.edit4,'String'));
gset=get(handles.text11,'String');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((69.75-s1)/69.75))*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 '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

% --- Executes on button press in pushbutton7.


function pushbutton7_Callback(hObject, eventdata, handles)
% 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)
c=str2double(get(handles.edit7,'String'));
gset=get(handles.text11,'String');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((48-c)/48))*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 'Second Iteration'
if (abs((-0.816-c)/-0.816))*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 '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

% --- Executes on button press in pushbutton8.


function pushbutton8_Callback(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)
x3=str2double(get(handles.edit8,'String'));
gset=get(handles.text11,'String');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((3.976487-x3)/3.976487))*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
case 'Second 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
case 'Third 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
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

% --- Executes on button press in pushbutton9.


function pushbutton9_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
gset=get(handles.text11,'String');
ea=str2double(get(handles.edit9,'String'));
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((25.74-ea)/25.74))*100 <= 0.05
set(handles.text20,'String','Correct');
set(handles.pushbutton2,'visible','on');
set(handles.pushbutton13,'enable','off');
msgbox('All answers are correct! We can now proceed to the second iteration
by pressing Next ', 'Success');
pause(0.1);
Speak(obj,char('All answers are correct! We can now proceed to the second i
teration by pressing Next'));
else
set(handles.text20,'String','Incorrect');

Speak(obj,char('Your answer is incorrect'));


end
if isnan(ea)
set(handles.text20,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Second Iteration'
if (abs((0.596-ea)/0.596))*100 <= 0.05
set(handles.text20,'String','Correct');
set(handles.pushbutton2,'visible','on');
set(handles.pushbutton13,'enable','off');
msgbox('All answers are correct! We can now proceed to the third iteration b
y pressing Next ', 'Success');
Speak(obj,char('All answers are correct! We can now proceed to the second i
teration by pressing Next'));
else
set(handles.text20,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(ea)
set(handles.text20,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Third Iteration'
if (abs((0.009-ea)/0.009))*100 <= 0.05
set(handles.text20,'String','Correct');
set(handles.pushbutton2,'visible','on');
set(handles.pushbutton13,'enable','off');
msgbox('All answers are correct! We can now proceed to the fourth iteration
by pressing Next ', 'Success');
Speak(obj,char('All answers are correct! We can now proceed to the third ite
ration by pressing Next'));
else
set(handles.text20,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));
end
if isnan(ea)
set(handles.text20,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
case 'Fourth Iteration'
if (abs((0-ea)/0.00001))*100 <= 0.05
set(handles.text20,'String','Correct');
set(handles.pushbutton2,'visible','on');
msgbox('You can now exit by pressing FINISH and restart by pressing RESTART'
, 'BOT');
msgbox('All answers are correct! You have completed the assessment test!', '
Success');
set(handles.pushbutton2,'String','Finish');
set(handles.pushbutton12,'visible','on');
set(handles.pushbutton13,'enable','off');
Speak(obj,char('All answers are correct. You have completed the assessment
test. You can now exit by pressing FINISH and restart by pressing RESTART'));
else
set(handles.text20,'String','Incorrect');
Speak(obj,char('Your answer is incorrect'));

end
if isnan(ea)
set(handles.text20,'String',' ');
msgbox('Avoid entering non-numeric values','ERROR');
end
end

% --- Executes on button press in pushbutton10.


function pushbutton10_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton10 (see GCBO)'
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
b=str2double(get(handles.edit6,'String'));
gset=get(handles.text11,'String');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs((62.25-b)/62.25))*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 'Second Iteration'
if (abs((33.902-b)/33.902))*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 '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

% --- Executes on button press in pushbutton11.


function pushbutton11_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
a=str2double(get(handles.edit5,'String'));
gset=get(handles.text11,'String');
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
switch gset
case 'First Iteration'
if (abs(15-a)/15)*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 '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'));

if (abs(11.977-a)/11.977)*100 <= 0.05


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
end

% --- Executes on button press in pushbutton12.


function pushbutton12_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
answer = questdlg('Are you sure?','RESTART','Yes','No','Yes')
Speak(obj,char('Are you sure?'));
switch answer
case 'Yes'
close(gcbf);
restart_gui;
case 'No'
return
end
% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
p13=get(handles.pushbutton13,'String');
gset=get(handles.text11,'String');
g1=get(handles.text12,'String');g2=get(handles.text13,'String');g3=get(handles.t
ext14,'String');g4=get(handles.text15,'String');
g5=get(handles.text16,'String');g6=get(handles.text17,'String');g7=get(handles.t
ext18,'String');g8=get(handles.text19,'String');g9=get(handles.text20,'String');
h0=str2double(get(handles.edit1,'String'));h1=str2double(get(handles.edit2,'Stri
ng'));s0=str2double(get(handles.edit3,'String'));s1=str2double(get(handles.edit4
,'String'));
a=str2double(get(handles.edit5,'String'));b=str2double(get(handles.edit6,'String
'));c=str2double(get(handles.edit7,'String'));x3=str2double(get(handles.edit8,'S
tring'));
ea=str2double(get(handles.edit9,'String'));
switch gset

case 'First 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 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,'2 Hints left')
set(handles.pushbutton13,'String','1 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,'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')

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,'2 Hints left')
set(handles.pushbutton13,'String','1 Hint 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')
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,'1 Hint left')
set(handles.pushbutton13,'String','0
if strcmp(g1,'Incorrect') || isnan(h0)
msgbox('The correct answer is between
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between
end
if isnan(s1) || strcmp(g4,'Incorrect');
msgbox('The correct answer is between
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

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')

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 -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,'0 Hint left')
msgbox('Im sorry. You ran out of hints','HINT');
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Fourth 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 0 and 2','HINT')


end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between -1 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 30 and 40','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 0 and 2','HINT')
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between -1 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 30 and 40','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,'1 Hint left')

set(handles.pushbutton13,'String','0 Hint left');


if strcmp(g1,'Incorrect') || isnan(h0)
msgbox('The correct answer is between 0 and 2','HINT')
end
if isnan(h1) || strcmp(g2,'Incorrect');
msgbox('The correct answer is between -1 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 30 and 40','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,'0 Hint left')
msgbox('Im sorry. You ran out of hints','HINT');
end
end

% --- Executes on button press in pushbutton14.


function pushbutton14_Callback(hObject, eventdata, handles)
% 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)
set(handles.pushbutton14, 'visible','off');
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', [534,530,114,118])
set(hc, 'visible','off')
set([handles.text1,hc], 'visible','on');
pause(0.01);
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;

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

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Assessment_Bairstow_OpeningFcn, ...
'gui_OutputFcn', @Assessment_Bairstow_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Assessment_Bairstow is made visible.
function Assessment_Bairstow_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% varargin command line arguments to Assessment_Bairstow (see VARARGIN)
% Choose default command line output for Assessment_Bairstow
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Assessment_Bairstow wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Assessment_Bairstow_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;
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton1 (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 radiobutton1
% --- Executes on button press in checkbox1.

function checkbox1_Callback(hObject, eventdata, handles)


% hObject
handle to checkbox1 (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 checkbox1

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

function edit2_Callback(hObject, eventdata, handles)


% hObject
handle to edit2 (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 edit2 as text
%
str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (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

function edit3_Callback(hObject, eventdata, handles)


% hObject
handle to edit3 (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 edit3 as text


%
str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (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

function edit4_Callback(hObject, eventdata, handles)


% hObject
handle to edit4 (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 edit4 as text
%
str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit4 (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

function edit5_Callback(hObject, eventdata, handles)


% hObject
handle to edit5 (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 edit5 as text
%
str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit5 (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

function edit6_Callback(hObject, eventdata, handles)


% hObject
handle to edit6 (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 edit6 as text
%
str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit6 (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
% --- 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)
b5c5=get(handles.text3,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
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') ;
set(handles.text4,'visible','on');
set(handles.edit2,'visible','on');
set(handles.pushbutton2,'visible','on') ;
else
set(handles.text9,'visible','on');
set(handles.text9,'String','Incorrect');
end
if isnan(b5)
set(handles.text9,'visible','off');

errordlg('Avoid entering non-numeric values','ERROR');


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
case 'c5:'
c5=str2double(get(handles.edit1,'String'));
if (abs((1-c5)/1)*100)<=0.05
set(handles.text9,'visible','on');
set(handles.text9,'String','Correct');
set(handles.edit1,'enable','off')
set(handles.pushbutton1,'enable','off') ;
set(handles.text4,'visible','on');
set(handles.edit2,'visible','on');
set(handles.pushbutton2,'visible','on');
set(handles.text4,'String','c4:');

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');

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
case 'c5:'
c5=str2double(get(handles.edit1,'String'));
if (abs((1-c5)/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(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

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
b4c4=get(handles.text4,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
switch b4c4
case 'b4:'
b4=str2double(get(handles.edit2,'String'));
if (abs((-4.5-b4)/-4.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.edit3,'visible','on');
set(handles.pushbutton3,'visible','on') ;
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((-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

% --- Executes on button press in pushbutton3.


function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
b3c3=get(handles.text5,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
switch b3c3
case 'b3:'
b3=str2double(get(handles.edit3,'String'));
if (abs((6.25-b3)/6.25)*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') ;
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((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

% --- 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)
b2c2=get(handles.text6,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
switch b2c2
case 'b2:'
b2=str2double(get(handles.edit4,'String'));
if (abs((0.375-b2)/0.375)*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') ;
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');


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);
set(handles.text12,'String','

');

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

% --- Executes on button press in pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
b1c1=get(handles.text7,'String');
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
switch b1c1
case 'b1:'
b1=str2double(get(handles.edit5,'String'));
if (abs((-10.5-b1)/-10.5)*100)<=0.05
set(handles.text13,'visible','on');
set(handles.text13,'String','Correct');
set(handles.edit5,'enable','off')
set(handles.pushbutton5,'enable','off') ;
set(handles.text8,'visible','on');
set(handles.edit6,'visible','on');
set(handles.pushbutton6,'visible','on') ;
else
set(handles.text13,'visible','on');
set(handles.text13,'String','Incorrect');
end
if isnan(b1)
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
case 'c1:'
c1=str2double(get(handles.edit5,'String'));
if (abs((-16.375-c1)/-16.375)*100)<=0.05
set(handles.text13,'visible','on');
set(handles.text13,'String','Correct');
set(handles.edit5,'enable','off')
set(handles.pushbutton5,'enable','off') ;
set(handles.text15,'visible','on');
set(handles.edit7,'visible','on')
set(handles.edit8,'visible','on');set(handles.edit9,'visible','on');
set(handles.edit10,'visible','on');set(handles.edit11,'visible','on');set(ha
ndles.edit12,'visible','on');
set(handles.text16,'visible','on');set(handles.text19,'visible','on');
set(handles.text17,'visible','on');set(handles.text18,'visible','on');
set(handles.pushbutton7,'visible','on') ;set(handles.pushbutton8,'visible','
on') ;

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');

errordlg('Avoid entering non-numeric values','JARVIS');


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
case 'c1:'
c1=str2double(get(handles.edit5,'String'));
if (abs((4.7874-c1)/4.7874)*100)<=0.05
set(handles.text13,'visible','on');
set(handles.text13,'String','Correct');
set(handles.edit5,'enable','off')
set(handles.pushbutton5,'enable','off') ;
set(handles.text15,'visible','on');
set(handles.edit7,'visible','on')
set(handles.edit8,'visible','on');set(handles.edit9,'visible','on');
set(handles.edit10,'visible','on');set(handles.edit11,'visible','on');set(handle
s.edit12,'visible','on');
set(handles.text16,'visible','on');set(handles.text19,'visible','on');
set(handles.text17,'visible','on');set(handles.text18,'visible','on');
set(handles.pushbutton7,'visible','on') ;set(handles.pushbutton8,'visible','on')
;
set(handles.pushbutton7,'enable','on');set(handles.pushbutton8,'enable','on');
set(handles.pushbutton7,'String','check');set(handles.pushbutton8,'String','chec
k');
set(handles.pushbutton9,'String','check');set(handles.pushbutton10,'String','che
ck');
set(handles.radiobutton2,'value',0);set(handles.radiobutton3,'value',0);set(hand
les.radiobutton4,'value',0);set(handles.radiobutton5,'value',0);
set(handles.radiobutton6,'value',0);set(handles.radiobutton7,'value',0);set(hand
les.radiobutton8,'value',0);set(handles.radiobutton9,'value',0);
set(handles.radiobutton2,'enable','on');set(handles.radiobutton3,'enable','on');
set(handles.radiobutton4,'enable','on');
set(handles.radiobutton5,'enable','on');set(handles.radiobutton6,'enable','on');
set(handles.radiobutton7,'enable','on');
set(handles.radiobutton8,'enable','on');set(handles.radiobutton9,'enable','on');
else
set(handles.text13,'visible','on');
set(handles.text13,'String','Incorrect');
end
if isnan(c1)
set(handles.text13,'visible','off');
errordlg('Avoid entering non-numeric values','JARVIS');
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

% --- Executes on button press in pushbutton6.

function pushbutton6_Callback(hObject, eventdata, handles)


% hObject
handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
b0=str2double(get(handles.edit6,'String'));
textset=get(handles.text25,'String');
if strcmp(textset,'r = -1 ')
if (abs((11.375-b0)/11.375)*100)<=0.05
set(handles.text14,'visible','on');
set(handles.text14,'String','Correct');
pause(0.5);
set(handles.edit6,'enable','off');
set(handles.pushbutton6,'enable','off') ;
set(handles.pushbutton6,'visible','off') ;
set(handles.text8,'visible','off') ;
set(handles.edit6,'visible','off') ;
set(handles.text14,'visible','off') ;
set(handles.edit1,'enable','on') ;
set(handles.text3,'String','c5:');
set(handles.pushbutton1,'enable','on');
set(handles.pushbutton2,'enable','on');set(handles.pushbutton3,'enable','on'
);
set(handles.pushbutton4,'enable','on');set(handles.pushbutton5,'enable','on'
);
set(handles.edit2,'visible','off');
set(handles.edit3,'visible','off'); set(handles.edit4,'visible','off'); set(
handles.edit5,'visible','off');
set(handles.pushbutton2,'visible','off');set(handles.pushbutton3,'visible','
off') ;set(handles.pushbutton4,'visible','off') ;
set(handles.pushbutton5,'visible','off');
set(handles.text9,'String',' ');set(handles.text10,'String',' ') ;set(handle
s.text11,'String',' ') ;
set(handles.text12,'String','') ;set(handles.text13,'String',' ') ;
set(handles.text4,'visible','off') ; set(handles.text5,'visible','off') ; se
t(handles.text6,'visible','off') ;
set(handles.text7,'visible','off') ;
set(handles.edit1,'String',' ');set(handles.edit2,'String',' ');set(handles.
edit3,'String',' ');
set(handles.edit4,'String',' ');set(handles.edit5,'String',' ');
set(handles.edit2,'enable','on');set(handles.edit3,'enable','on');set(handle
s.edit4,'enable',' on');
set(handles.edit5,'enable','on');
set(handles.text10,'visible','off');set(handles.text11,'visible','off');set(
handles.text12,'visible','off');
set(handles.text13,'visible','off');set(handles.text14,'visible','off');set(
handles.text9,'visible','off');
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
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

function edit7_Callback(hObject, eventdata, handles)


% hObject
handle to edit7 (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 edit7 as text
%
str2double(get(hObject,'String')) returns contents of edit7 as a double
% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit7 (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

function edit8_Callback(hObject, eventdata, handles)


% hObject
handle to edit8 (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 edit8 as text


%
str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (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

function edit9_Callback(hObject, eventdata, handles)


% hObject
handle to edit9 (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 edit9 as text
%
str2double(get(hObject,'String')) returns contents of edit9 as a double
% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit9 (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

function edit10_Callback(hObject, eventdata, handles)


% hObject
handle to edit10 (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 edit10 as text
%
str2double(get(hObject,'String')) returns contents of edit10 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit10 (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

function edit11_Callback(hObject, eventdata, handles)


% hObject
handle to edit11 (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 edit11 as text
%
str2double(get(hObject,'String')) returns contents of edit11 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit11 (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

function edit12_Callback(hObject, eventdata, handles)


% hObject
handle to edit12 (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 edit12 as text
%
str2double(get(hObject,'String')) returns contents of edit12 as a doubl
e
% --- Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit12 (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
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)

% 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

s((-b02-e9)/-b02)*100) <=0.05)) || (((abs((c22-e7)/c22)*100)<=0.05) && ((abs((c3


2-e8)/c32)*100)<=0.05) && ((abs((-b12-e9)/-b12))<=0.05))) && ((e7 ~= e10) || (e8
~= e11) || (e9 ~= e12))
set(handles.text20,'String','Correct')
set(handles.text20,'visible','on')
set(handles.pushbutton7,'enable','off');
set(handles.pushbutton7,'String','Next');
set(handles.pushbutton8,'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.text20,'visible','on')
set(handles.text20,'String','Incorrect')
end
if isnan(e7) || isnan(e8) || isnan(e9)
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

function pushbutton8_Callback(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)
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;
text20=get(handles.text20,'String');
text21=get(handles.text21,'String');
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'));
p8=get(handles.pushbutton8,'String');
textset=get(handles.text25,'String');

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

% --- Executes on button press in radiobutton2.


function radiobutton2_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton2 (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 radiobutton2
a=get(handles.radiobutton2,'value');
b=get(handles.radiobutton3,'value');
c=get(handles.radiobutton4,'value');
d=get(handles.radiobutton5,'value');
if a == 1;
set(handles.text24,'String',' ');
set(handles.radiobutton3,'value',0);
set(handles.radiobutton4,'value',0);
set(handles.radiobutton5,'value',0);
end

% --- Executes on button press in radiobutton3.


function radiobutton3_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton3 (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 radiobutton


a=get(handles.radiobutton2,'value');
b=get(handles.radiobutton3,'value');
c=get(handles.radiobutton4,'value');
d=get(handles.radiobutton5,'value');
if b == 1;
set(handles.text24,'String',' ');
set(handles.radiobutton2,'value',0);
set(handles.radiobutton4,'value',0);
set(handles.radiobutton5,'value',0);
end

% --- Executes on button press in radiobutton4.


function radiobutton4_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton4 (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 radiobutton4
a=get(handles.radiobutton2,'value');
b=get(handles.radiobutton3,'value');
c=get(handles.radiobutton4,'value');
d=get(handles.radiobutton5,'value');
if c == 1;
set(handles.text24,'String',' ');
set(handles.radiobutton2,'value',0);
set(handles.radiobutton3,'value',0);
set(handles.radiobutton5,'value',0);
end
% --- Executes on button press in radiobutton5.
function radiobutton5_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton5 (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 radiobutton5
a=get(handles.radiobutton2,'value');
b=get(handles.radiobutton3,'value');
c=get(handles.radiobutton4,'value');
d=get(handles.radiobutton5,'value');
if d == 1;
set(handles.text24,'String',' ');
set(handles.radiobutton2,'value',0);
set(handles.radiobutton3,'value',0);
set(handles.radiobutton4,'value',0);
end
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
a=get(handles.radiobutton2,'value')
b=get(handles.radiobutton3,'value')

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

% --- Executes during object deletion, before destroying properties.


function text24_DeleteFcn(hObject, eventdata, handles)
% hObject
handle to text24 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% --- Executes on button press in radiobutton6.
function radiobutton6_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton6 (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 radiobutton6
a=get(handles.radiobutton6,'value');
b=get(handles.radiobutton7,'value');
c=get(handles.radiobutton8,'value');
d=get(handles.radiobutton9,'value');
if a == 1;
set(handles.text29,'String',' ');
set(handles.radiobutton7,'value',0);
set(handles.radiobutton8,'value',0);
set(handles.radiobutton9,'value',0);
end
% --- Executes on button press in radiobutton7.
function radiobutton7_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton7 (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 radiobutton7


a=get(handles.radiobutton6,'value');
b=get(handles.radiobutton7,'value');
c=get(handles.radiobutton8,'value');
d=get(handles.radiobutton9,'value');
if b == 1;
set(handles.text29,'String',' ');
set(handles.radiobutton6,'value',0);
set(handles.radiobutton8,'value',0);
set(handles.radiobutton9,'value',0);
end
% --- Executes on button press in radiobutton8.
function radiobutton8_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton8 (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 radiobutton8
a=get(handles.radiobutton6,'value');
b=get(handles.radiobutton7,'value');
c=get(handles.radiobutton8,'value');
d=get(handles.radiobutton9,'value');
if c == 1;
set(handles.text29,'String',' ');
set(handles.radiobutton6,'value',0);
set(handles.radiobutton7,'value',0);
set(handles.radiobutton9,'value',0);
end
% --- Executes on button press in radiobutton9.
function radiobutton9_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton9 (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 radiobutton9
a=get(handles.radiobutton6,'value');
b=get(handles.radiobutton7,'value');
c=get(handles.radiobutton8,'value');
d=get(handles.radiobutton9,'value');
if d == 1;
set(handles.text29,'String',' ');
set(handles.radiobutton6,'value',0);
set(handles.radiobutton7,'value',0);
set(handles.radiobutton8,'value',0);
end
% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
p10=get(handles.pushbutton10,'String');
a=get(handles.radiobutton6,'value')

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

% --- Executes on button press in pushbutton12.


function pushbutton12_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
set(handles.text1,'visible','on');
set(handles.pushbutton12,'visible','off');
pause(0.1);
defaultString=('Employ Bairstows method to determine the two of the roots of the
polynomial ef of ex is equal to ex raised to five minus three point five ex rai
sed to four plus two point seventy-five ex raised to three plus two point one tw
o five ex raised to two minus three point eight seven five ex plus one point twe
nty-five. Use initial guesses r and s equal to negative one and iterate to a lev
el of approximate error equal to one percent')
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
caUserInput = char(defaultString); % Convert from cell to string.
Speak(obj, caUserInput);
pause(0.1)
set(handles.text25,'visible','on');
set(handles.text2,'visible','on');
set(handles.text26,'visible','on');
set(handles.edit1,'visible','on');
set(handles.pushbutton1,'visible','on');
set(handles.text3,'visible','on');
set(handles.text32,'visible','on');

% --- Executes during object creation, after setting all properties.


function pushbutton10_CreateFcn(hObject, eventdata, handles)
% hObject
handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
g1=get(handles.text9,'String');g2=get(handles.text10,'String');g3=get(handles.te

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

% --- Executes on button press in radiobutton11.


function radiobutton11_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton11 (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 radiobutton11
e=get(handles.radiobutton10,'value');
f=get(handles.radiobutton11,'value');
g=get(handles.radiobutton12,'value');
h=get(handles.radiobutton13,'value');
if f == 1;
set(handles.radiobutton10,'value',0);
set(handles.radiobutton12,'value',0);
set(handles.radiobutton13,'value',0);
end
% --- Executes on button press in radiobutton12.
function radiobutton12_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton12 (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 radiobutton12
e=get(handles.radiobutton10,'value');
f=get(handles.radiobutton11,'value');
g=get(handles.radiobutton12,'value');
h=get(handles.radiobutton13,'value');
if g == 1;
set(handles.radiobutton13,'value',0);
set(handles.radiobutton11,'value',0);
set(handles.radiobutton10,'value',0);
end
% --- Executes on button press in radiobutton13.
function radiobutton13_Callback(hObject, eventdata, handles)
% hObject
handle to radiobutton13 (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 radiobutton13
e=get(handles.radiobutton10,'value');
f=get(handles.radiobutton11,'value');
g=get(handles.radiobutton12,'value');
h=get(handles.radiobutton13,'value');
if h == 1;
set(handles.radiobutton10,'value',0);
set(handles.radiobutton11,'value',0);
set(handles.radiobutton12,'value',0);
end
% --- Executes on button press in pushbutton14.
function pushbutton14_Callback(hObject, eventdata, handles)

% 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

% --- 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)
% --- 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)
% --- Executes on button press in pushbutton18.
function pushbutton18_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton18 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
answer = questdlg('Are you sure?','JARVIS','Yes','No','Yes');
switch answer
case 'Yes'

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)

Das könnte Ihnen auch gefallen