📄 transfer_alignment_modify_simulation_systme.m
字号:
function varargout = transfer_alignment_modify_simulation_systme(varargin)
% TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME M-file for transfer_alignment_modify_simulation_systme.fig
% TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME, by itself, creates a new TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME or raises the existing
% singleton*.
%
% H = TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME returns the handle to a new TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME or the handle to
% the existing singleton*.
%
% TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME.M with the given input arguments.
%
% TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME('Property','Value',...) creates a new TRANSFER_ALIGNMENT_MODIFY_SIMULATION_SYSTME or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before transfer_alignment_modify_simulation_systme_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to transfer_alignment_modify_simulation_systme_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 transfer_alignment_modify_simulation_systme
% Last Modified by GUIDE v2.5 06-Jun-2006 20:57:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @transfer_alignment_modify_simulation_systme_OpeningFcn, ...
'gui_OutputFcn', @transfer_alignment_modify_simulation_systme_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 transfer_alignment_modify_simulation_systme is made visible.
function transfer_alignment_modify_simulation_systme_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 transfer_alignment_modify_simulation_systme (see VARARGIN)
% Choose default command line output for transfer_alignment_modify_simulation_systme
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes transfer_alignment_modify_simulation_systme wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = transfer_alignment_modify_simulation_systme_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 checkbox1.% --- Executes during object creation, after setting all properties.function sd_CreateFcn(hObject, eventdata, handles)% hObject handle to sd (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'));endfunction sd_Callback(hObject, eventdata, handles)% hObject handle to sd (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 sd as text% str2double(get(hObject,'String')) returns contents of sd as a double% --- Executes during object creation, after setting all properties.function hxj_CreateFcn(hObject, eventdata, handles)% hObject handle to hxj (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'));endfunction hxj_Callback(hObject, eventdata, handles)% hObject handle to hxj (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 hxj as text% str2double(get(hObject,'String')) returns contents of hxj as a double% --- Executes during object creation, after setting all properties.function gd_CreateFcn(hObject, eventdata, handles)% hObject handle to gd (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'));endfunction gd_Callback(hObject, eventdata, handles)% hObject handle to gd (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 gd as text% str2double(get(hObject,'String')) returns contents of gd as a double% --- Executes during object creation, after setting all properties.function jd_CreateFcn(hObject, eventdata, handles)% hObject handle to jd (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'));endfunction jd_Callback(hObject, eventdata, handles)% hObject handle to jd (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 jd as text% str2double(get(hObject,'String')) returns contents of jd as a double% --- Executes during object creation, after setting all properties.function wd_CreateFcn(hObject, eventdata, handles)% hObject handle to wd (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'));endfunction wd_Callback(hObject, eventdata, handles)% hObject handle to wd (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 wd as text% str2double(get(hObject,'String')) returns contents of wd as a double% --- 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)hxj = str2double(get(handles.hxj,'String')); %提取航向角的值
sd = str2double(get(handles.sd,'String')); %提取速度的值
jd = str2double(get(handles.jd,'String')); %提取经度的值
wd = str2double(get(handles.wd,'String')); %提取纬度的值
gd = str2double(get(handles.gd,'String')); %提取高度的值
jcx = str2double(get(handles.edit6,'String'));%提取%加速度计误差白噪声方差X轴
jcy = str2double(get(handles.edit7,'String'));%提取%加速度计误差白噪声方差Y轴
jcz = str2double(get(handles.edit8,'String'));%提取%加速度计误差白噪声方差Z轴
tcx = str2double(get(handles.edit10,'String'));%提取陀螺误差白噪声方差X轴
tcy = str2double(get(handles.edit11,'String'));%提取陀螺误差白噪声方差Y轴
tcz = str2double(get(handles.edit12,'String'));%提取陀螺误差白噪声方差Z轴
ncx = str2double(get(handles.edit13,'String'));%提取挠曲变形误差白噪声方差X轴
ncy = str2double(get(handles.edit14,'String'));%提取挠曲变形误差白噪声方差Y轴
ncz = str2double(get(handles.edit15,'String'));%提取挠曲变形误差白噪声方差Z轴
syv=get(handles.sy,'value'); %获取各单元按钮的值
sjv=get(handles.sj,'value');
sxv=get(handles.sx,'value');
pgv=get(handles.pg,'value');
scsjv=get(handles.scsj,'value');
if syv==1 %选择飞行轨迹或实测参数
aq=1
elseif sjv==1
aq=2
elseif sxv==1
aq=3
elseif pgv==1
aq=4
elseif scsjv==1
aq=5
end
transfer_alignment_modify(hxj,sd,jd,wd,gd,aq,jcx,jcy,jcz,tcx,tcy,tcz,ncx,ncy,ncz)% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% 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)syv=get(handles.sy,'value'); %获取各单元按钮的值
sjv=get(handles.sj,'value');
sxv=get(handles.sx,'value');
pgv=get(handles.pg,'value');
scsjv=get(handles.scsj,'value');
if syv==1 %选择所绘图的类别
aq=1
elseif sjv==1
aq=2
elseif sxv==1
aq=3
elseif pgv==1
aq=4
elseif scsjv==1
aq=5
end
load trans_data.txt
t=trans_data(:,1);
x=trans_data(:,8);
y=trans_data(:,9);
z=trans_data(:,10);
n=length(t);
plot3(x,y,z,'color','w','Parent',handles.fxgj);
set(handles.fxgj,'XGrid','on','YGrid','on','ZGrid','on');
xlabel('经度(单位:度)'),ylabel('纬度(单位:度)'),zlabel('高度(单位:米)');%绘制飞行轨迹图
if syv==1
h=line(x,y,z,'color','b','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold off
elseif sjv==1
h=line(x,y,z,'color','g','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold off
elseif sxv==1
h=line(x,y,z,'color','y','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold off
elseif pgv==1
h=line(x,y,z,'color','r','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold off
elseif scsjv==1
h=line(x,y,z,'color','k','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold off
end
i=1;
set(h,'xdata',x(i),'ydata',y(i),'zdata',z(i),'Parent',handles.fxgj);%绘制动态飞行轨迹
while i<n
set(h,'xdata',x(i),'ydata',y(i),'zdata',z(i),'Parent',handles.fxgj);
drawnow;
pause(0.02);
i=i+1;
end
rotate3d(handles.figure1)
if syv==1
line(x,y,z,'color','b','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj) %在轴上保留飞行规机
hold on
elseif sjv==1
line(x,y,z,'color','g','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold on
elseif sxv==1
line(x,y,z,'color','y','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold on
elseif pgv==1
line(x,y,z,'color','r','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold on
elseif scsjv==1
line(x,y,z,'color','k','markersize',15,'linestyle','.','erasemode','none','marker','.','Parent',handles.fxgj)
hold on
end
% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -