function varargout = konghuaqi(varargin)
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @konghuaqi_OpeningFcn, ...
'gui_OutputFcn', @konghuaqi_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(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 konghuaqi is made visible.
function konghuaqi_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 konghuaqi (see VARARGIN)
% Choose default command line output for konghuaqi
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes konghuaqi wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = konghuaqi_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 Plot_push.
function Plot_push_Callback(hObject, eventdata, handles)
%global DeltaCav DeltaFinE Theta
DeltaCav=str2num(get(handles.Cav_edit,'String'))*pi/180;
DeltaFinE=str2num(get(handles.FinE_edit,'String'))*pi/180;
Theta=str2num(get(handles.Fashe_edit,'String'));
y0=[60 0 0 Theta*pi/180 0 0];%给函数赋初值
tspan=[0 10];
[t,y]=ode45('projectiledes',tspan,y0,[],DeltaCav,DeltaFinE,Theta);
plot(y(:,5),y(:,6),'r'),grid on
xlabel('\fontsize{14} \bfU\rightarrow')
ylabel('\fontsize{14} \bfW\rightarrow')
legend(['弹道曲线'])
% hold on
% hObject handle to Plot_push (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 Cav_edit_CreateFcn(hObject, eventdata, handles)
% hObject handle to Cav_edit (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 Cav_edit_Callback(hObject, eventdata, handles)
% hObject handle to Cav_edit (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 Cav_edit as text
% str2double(get(hObject,'String')) returns contents of Cav_edit as a double
% --- Executes during object creation, after setting all properties.
function FinE_edit_CreateFcn(hObject, eventdata, handles)
% hObject handle to FinE_edit (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 FinE_edit_Callback(hObject, eventdata, handles)
% hObject handle to FinE_edit (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 FinE_edit as text
% str2double(get(hObject,'String')) returns contents of FinE_edit as a double
% --- Executes during object creation, after setting all properties.
function Fashe_edit_CreateFcn(hObject, eventdata, handles)
% hObject handle to Fashe_edit (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 Fashe_edit_Callback(hObject, eventdata, handles)
% hObject handle to Fashe_edit (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 Fashe_edit as text
% str2double(get(hObject,'String')) returns contents of Fashe_edit as a double
% --- Executes on button press in WT_push.
function WT_push_Callback(hObject, eventdata, handles)
% hObject handle to WT_push (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%global DeltaCav DeltaFinE Theta
DeltaCav=str2num(get(handles.Cav_edit,'String'))*pi/180;
DeltaFinE=str2num(get(handles.FinE_edit,'String'))*pi/180;
Theta=str2num(get(handles.Fashe_edit,'String'));
y0=[60 0 0 Theta*pi/180 0 0];%给函数赋初值
tspan=[0 10];
[t,y]=ode45('projectiledes',tspan,y0,[],DeltaCav,DeltaFinE,Theta);
%subplot(2,3,1),plot(Edit_text2,y(:,1))
%subplot(2,3,2),plot(Edit_text2,y(:,2))
%subplot(2,3,3),plot(Edit_text2,y(:,3))
%subplot(2,3,4),plot(Edit_text2,y(:,4))
%subplot(2,3,5),
plot(t,y(:,2),'r'),grid on
xlabel('\fontsize{14} \bft\rightarrow')
ylabel('\fontsize{14} \bfW\rightarrow')
% hold on
% --- Executes on button press in qT_push.
function qT_push_Callback(hObject, eventdata, handles)
% hObject handle to qT_push (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%global DeltaCav DeltaFinE Theta //18号去掉
DeltaCav=str2num(get(handles.Cav_edit,'String'))*pi/180;
DeltaFinE=str2num(get(handles.FinE_edit,'String'))*pi/180;
Theta=str2num(get(handles.Fashe_edit,'String'));
y0=[60 0 0 Theta*pi/180 0 0];%给函数赋初值
tspan=[0 10];
[t,y]=ode45('projectiledes',tspan,y0,[],DeltaCav,DeltaFinE,Theta);
%subplot(2,3,1),plot(Edit_text2,y(:,1))
%subplot(2,3,2),plot(Edit_text2,y(:,2))
%subplot(2,3,3),plot(Edit_text2,y(:,3))
%subplot(2,3,4),plot(Edit_text2,y(:,4))
%subplot(2,3,5),
plot(t,y(:,3),'r'),grid on
xlabel('\fontsize{14} \bft\rightarrow')
ylabel('\fontsize{14} \bfq\rightarrow')
% hold on
% --- Executes on button press in UT_push.
function UT_push_Callback(hObject, eventdata, handles)
% hObject handle to UT_push (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%global DeltaCav DeltaFinE Theta
DeltaCav=str2num(get(handles.Cav_edit,'String'))*pi/180;
DeltaFinE=str2num(get(handles.FinE_edit,'String'))*pi/180;
Theta=str2num(get(handles.Fashe_edit,'String'));
y0=[60 0 0 Theta*pi/180 0 0];%给函数赋初值
tspan=[0 10];
[t,y]=o