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

Posted 紫极神光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无人机基于matlab GUI无人机模拟飞行含Matlab源码 1183期相关的知识,希望对你有一定的参考价值。

一、简介

基于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

以上是关于无人机基于matlab GUI无人机模拟飞行含Matlab源码 1183期的主要内容,如果未能解决你的问题,请参考以下文章

无人机基于matlab粒子群算法优化干扰受限下无人机群辅助网络含Matlab源码 2245期

三维路径规划基于matlab粒子群算法无人机山地三维路径规划含Matlab源码 1831期

三维路径规划基于matlab球面矢量粒子群算法无人机三维路径规划含Matlab源码 1682期

三维路径规划基于matlab粒子群算法融合鸡群算法多无人机三维路径规划含Matlab源码 1792期

优化覆盖基于matlab粒子群算法优化无人机编队布局求解车载网络通信覆盖优化问题含Matlab源码 2021期

飞行器基于matlab四旋翼无人机几何跟踪控制含Matlab源码 2270期