function varargout = gram_schmt(varargin)
% GRAM_SCHMT M-file for gram_schmt.fig
% GRAM_SCHMT, by itself, creates a new GRAM_SCHMT or raises the existing
% singleton*.
%
% H = GRAM_SCHMT returns the handle to a new GRAM_SCHMT or the handle to
% the existing singleton*.
%
% GRAM_SCHMT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GRAM_SCHMT.M with the given input arguments.
%
% GRAM_SCHMT('Property','Value',...) creates a new GRAM_SCHMT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before gram_schmt_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to gram_schmt_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help gram_schmt
% Last Modified by GUIDE v2.5 26-Apr-2010 11:42:47
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @gram_schmt_OpeningFcn, ...
'gui_OutputFcn', @gram_schmt_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 gram_schmt is made visible.
function gram_schmt_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 gram_schmt (see VARARGIN)
% Choose default command line output for gram_schmt
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes gram_schmt wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = gram_schmt_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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
x=get(handles.edit1,'string');
s1=str2num(x);
y=get(handles.edit2,'string');
s2=str2num(y);
z=get(handles.edit3,'string');
s3=str2num(z);
k=get(handles.edit4,'string');
s4=str2num(k);
fy1=(s1/norm(s1));
s21=sum(s2.*fy1);
fy2d=(s2-(s21.*fy1));
fy2=fy2d/norm(fy2d);
s31=sum(s3.*fy1);
s32=sum(s3.*fy2);
fy3d=(s3-(s32.*fy2)-(s31.*fy1));
fy3=fy3d/norm(fy3d);
s41=sum(s4.*fy1);
s42=sum(s4.*fy2);
s43=sum(s4.*fy3);
fy4d=(s4-(s41.*fy1)-(s42.*fy2)-(s43.*fy3));
fy4=fy4d/norm(fy4d);
t=0.01:0.01:4;
g1=[];
for i=1:4
for j=1:100
g1=[g1 fy1(i)];
end
end
figure
subplot(4,1,1);
plot(t,g1);
title('fy1');
g2=[];
for i=1:4
for j=1:100
g2=[g2 fy2(i)];
end
end
subplot(412);
plot(t,g2);
title('fy2');
g3=[];
for i=1:4
for j=1:100
g3=[g3 fy3(i)];
end
end
subplot(413);
plot(t,g3);
title('fy3');
g4=[];
for i=1:4
for j=1:100
g4=[g4 fy4(i)];
end
end
subplot(414);
plot(t,g4);
title('fy4');
% 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 on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
close all;
% 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)
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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
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
% handle