ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

【无人机】基于matlab GUI无人机模拟飞行【含Matlab源码 1183期】

2021-08-04 10:04:36  阅读:257  来源: 互联网

标签:String see GUI hObject value handles 源码 无人机 eventdata


一、简介

基于matlab GUI无人机模拟飞行

二、部分源代码

 function varargout = GUI_Config(varargin)
% GUI_CONFIG MATLAB code for GUI_Config.fig
%      GUI_CONFIG, by itself, creates a new GUI_CONFIG or raises the existing
%      singleton*.
%
%      H = GUI_CONFIG returns the handle to a new GUI_CONFIG or the handle to
%      the existing singleton*.
%
%      GUI_CONFIG('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI_CONFIG.M_VALUE with the given input arguments.
%
%      GUI_CONFIG('Property','Value',...) creates a new GUI_CONFIG or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before GUI_Config_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to GUI_Config_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 GUI_Config

% Last Modified by GUIDE v2.5 26-Nov-2020 18:35:51

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @GUI_Config_OpeningFcn, ...
                   'gui_OutputFcn',  @GUI_Config_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 GUI_Config is made visible.
function GUI_Config_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 GUI_Config (see VARARGIN)

% Choose default command line output for GUI_Config
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);
set(handles.progresslabel,'String','未开始仿真');


% UIWAIT makes GUI_Config wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = GUI_Config_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 m_value_Callback(hObject, eventdata, handles)
% hObject    handle to m_value (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 m_value as text
%        str2double(get(hObject,'String')) returns contents of m_value as a double


% --- Executes during object creation, after setting all properties.
function m_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to m_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end





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


% --- Executes during object creation, after setting all properties.
function g_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to g_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end



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


% --- Executes during object creation, after setting all properties.
function L_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to L_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end



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


% --- Executes during object creation, after setting all properties.
function Ixx_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Ixx_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end



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


% --- Executes during object creation, after setting all properties.
function Iyy_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Iyy_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end



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


% --- Executes during object creation, after setting all properties.
function Izz_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Izz_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end


% --- Executes on button press in structParamClear.
function structParamClear_Callback(hObject, eventdata, handles)
% hObject    handle to structParamClear (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.m_value,'String','');
set(handles.g_value,'String','');
set(handles.L_value,'String','');
set(handles.Ixx_value,'String','');
set(handles.Iyy_value,'String','');
set(handles.Izz_value,'String','');

% --- Executes on button press in structParam_Default.
function structParam_Default_Callback(hObject, eventdata, handles)
% hObject    handle to structParam_Default (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.m_value,'String','0.5');
set(handles.g_value,'String','9.8');
set(handles.L_value,'String','0.2');
set(handles.Ixx_value,'String','0.114');
set(handles.Iyy_value,'String','0.114');
set(handles.Izz_value,'String','0.158');
set(handles.progresslabel,'String','结构参数使用默认参数');



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


% --- Executes during object creation, after setting all properties.
function xt_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to xt_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end



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


% --- Executes during object creation, after setting all properties.
function yt_value_CreateFcn(hObject, eventdata, handles)
% hObject    handle to yt_value (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
set(hObject,'String','');
% 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');
end

三、运行结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、备注

版本:2014a

标签:String,see,GUI,hObject,value,handles,源码,无人机,eventdata
来源: https://www.cnblogs.com/QQ912100926/p/15097526.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有