⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coe_gui.m

📁 空空导弹设计
💻 M
📖 第 1 页 / 共 2 页
字号:
function varargout = coe_gui(varargin)% COE_GUI M-file for coe_gui.fig%      COE_GUI, by itself, creates a new COE_GUI or raises the existing%      singleton*.%%      H = COE_GUI returns the handle to a new COE_GUI or the handle to%      the existing singleton*.%%      COE_GUI('CALLBACK',hObject,eventData,handles,...) calls the local%      function named CALLBACK in COE_GUI.M with the given input arguments.%%      COE_GUI('Property','Value',...) creates a new COE_GUI or raises the%      existing singleton*.  Starting from the left, property value pairs are%      applied to the GUI before coe_gui_OpeningFcn gets called.  An%      unrecognized property name or invalid value makes property application%      stop.  All inputs are passed to coe_gui_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 coe_gui% Last Modified by GUIDE v2.5 24-Mar-2008 16:54:20% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @coe_gui_OpeningFcn, ...                   'gui_OutputFcn',  @coe_gui_OutputFcn, ...                   'gui_LayoutFcn',  [] , ...                   'gui_Callback',   []);if nargin && ischar(varargin{1})    gui_State.gui_Callback = str2func(varargin{1});endif nargout    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else    gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDITend% --- Executes just before coe_gui is made visible.function coe_gui_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 coe_gui (see VARARGIN)% Choose default command line output for coe_guihandles.output = hObject;% Default valueshandles.coe.a = 36000;handles.coe.e = 0.8;handles.coe.inc = 0;handles.coe.omega = 0;handles.coe.w = 0;handles.coe.v = 0;handles.coe.r = 6378;% Update handles structureguidata(hObject, handles);% UIWAIT makes coe_gui wait for user response (see UIRESUME)% uiwait(handles.figure1);end% --- Outputs from this function are returned to the command line.function varargout = coe_gui_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 structurevarargout{1} = handles.output;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)endfunction edit_a_Callback(hObject, eventdata, handles)% hObject    handle to edit_a (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 edit_a as text%        str2double(get(hObject,'String')) returns contents of edit_a as a doublea = str2double(get(hObject,'String'));if isnan(a)    set(hObject, 'String', 0);    errordlg('Input must be a number','Error');end% Save the new density valuehandles.coe.a = a;guidata(hObject,handles)end% --- Executes during object creation, after setting all properties.function edit_a_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_a (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,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endendfunction edit_e_Callback(hObject, eventdata, handles)% hObject    handle to edit_e (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 edit_e as text%        str2double(get(hObject,'String')) returns contents of edit_e as a doublee = str2double(get(hObject,'String'));if isnan(e)    set(hObject, 'String', 0);    errordlg('Input must be a number','Error');end% Save the new density valuehandles.coe.e = e;guidata(hObject,handles)end% --- Executes during object creation, after setting all properties.function edit_e_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_e (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,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endendfunction edit_i_Callback(hObject, eventdata, handles)% hObject    handle to edit_i (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 edit_i as text%        str2double(get(hObject,'String')) returns contents of edit_i as a doubleinc = str2double(get(hObject,'String'));if isnan(inc)    set(hObject, 'String', 0);    errordlg('Input must be a number','Error');end% Save the new density valuehandles.coe.inc = inc;guidata(hObject,handles)end% --- Executes during object creation, after setting all properties.function edit_i_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_i (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,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endendfunction edit_omega_Callback(hObject, eventdata, handles)% hObject    handle to edit_omega (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 edit_omega as text%        str2double(get(hObject,'String')) returns contents of edit_omega as a doubleomega = str2double(get(hObject,'String'));if isnan(omega)    set(hObject, 'String', 0);    errordlg('Input must be a number','Error');end% Save the new density valuehandles.coe.omega = omega;guidata(hObject,handles)end% --- Executes during object creation, after setting all properties.function edit_omega_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_omega (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,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endendfunction edit_w_Callback(hObject, eventdata, handles)% hObject    handle to edit_w (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 edit_w as text%        str2double(get(hObject,'String')) returns contents of edit_w as a doublew = str2double(get(hObject,'String'));if isnan(w)    set(hObject, 'String', 0);    errordlg('Input must be a number','Error');end% Save the new density valuehandles.coe.w = w;guidata(hObject,handles)end% --- Executes during object creation, after setting all properties.function edit_w_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_w (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,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endendfunction edit_v_Callback(hObject, eventdata, handles)% hObject    handle to edit_v (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 edit_v as text%        str2double(get(hObject,'String')) returns contents of edit_v as a doublev = str2double(get(hObject,'String'));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -