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

📄 kalman_gui.m

📁 MATLAB Simulations for Radar Systems Design
💻 M
📖 第 1 页 / 共 5 页
字号:
function varargout = kalman_gui(varargin)
% KALMAN_GUI M-file for kalman_gui.fig
%      KALMAN_GUI, by itself, creates a new KALMAN_GUI or raises the existing
%      singleton*.
%
%      H = KALMAN_GUI returns the handle to a new KALMAN_GUI or the handle to
%      the existing singleton*.
%
%      KALMAN_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in KALMAN_GUI.M with the given input arguments.
%
%      KALMAN_GUI('Property','Value',...) creates a new KALMAN_GUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before kalman_gui_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to kalman_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 kalman_gui

% Last Modified by GUIDE v2.5 17-Jun-2003 14:42:07
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @kalman_gui_OpeningFcn, ...
                   'gui_OutputFcn',  @kalman_gui_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 kalman_gui is made visible.
function kalman_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 kalman_gui (see VARARGIN)

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


% Update handles structure
guidata(hObject, handles);

if strcmp(get(hObject,'Visible'),'off')
    initialize_gui(hObject, handles);
end

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


% --- Outputs from this function are returned to the command line.
function varargout = kalman_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 structure
varargout{1} = handles.output;








function initialize_gui(fig_handle, handles)
data.start_loc = zeros(3,1);
data.velocity = 0.0 ;
data.yamp = 0.0 ;
data.yperiod = 0.0 ;
data.zamp = 0.0 ;
data.zperiod = 0.0 ;
data.samplingtime = 0.0 ;
data.deltat = 0.0 ;
data.sigmaaz = 0.0 ;
data.sigmael = 0.0 ;
data.sigmarange = 0.0 ;
data.x0 = zeros(6,1) ;
data.P0 = zeros(6,6) ;
data.phi = zeros(6,6) ;
data.R = zeros(3,3) ;
data.Q = zeros(6,6) ;

set(handles.xstart, 'String', data.start_loc(1));
set(handles.ystart, 'String', data.start_loc(2));
set(handles.zstart, 'String', data.start_loc(3));
set(handles.velocity, 'String', data.velocity);
set(handles.y_amp, 'String', data.yamp);
set(handles.y_period, 'String', data.yperiod);
set(handles.z_amp, 'String', data.zamp);
set(handles.z_period, 'String', data.zperiod);
set(handles.sampletime, 'String', data.samplingtime);
set(handles.deltat, 'String', data.deltat);
set(handles.sigmaaz, 'String', data.sigmaaz);
set(handles.sigmael, 'String', data.sigmael);
set(handles.sigmarange, 'String', data.sigmarange);

set(handles.x0_1, 'String', num2str(data.x0(1)));
set(handles.x0_2, 'String', num2str(data.x0(2)));
set(handles.x0_3, 'String', num2str(data.x0(3)));
set(handles.x0_4, 'String', num2str(data.x0(4)));
set(handles.x0_5, 'String', num2str(data.x0(5)));
set(handles.x0_6, 'String', num2str(data.x0(6)));

set(handles.P11, 'String', num2str(data.P0(1,1)) );
set(handles.P12, 'String', num2str(data.P0(1,2)) );
set(handles.P13, 'String', num2str(data.P0(1,3)) );
set(handles.P14, 'String', num2str(data.P0(1,4)) );
set(handles.P15, 'String', num2str(data.P0(1,5)) );
set(handles.P16, 'String', num2str(data.P0(1,6)) );
set(handles.P21, 'String', num2str(data.P0(2,1)) );
set(handles.P22, 'String', num2str(data.P0(2,2)) );
set(handles.P23, 'String', num2str(data.P0(2,3)) );
set(handles.P24, 'String', num2str(data.P0(2,4)) );
set(handles.P25, 'String', num2str(data.P0(2,5)) );
set(handles.P26, 'String', num2str(data.P0(2,6)) );
set(handles.P31, 'String', num2str(data.P0(3,1)) );
set(handles.P32, 'String', num2str(data.P0(3,2)) );
set(handles.P33, 'String', num2str(data.P0(3,3)) );
set(handles.P34, 'String', num2str(data.P0(3,4)) );
set(handles.P35, 'String', num2str(data.P0(3,5)) );
set(handles.P36, 'String', num2str(data.P0(3,6)) );
set(handles.P41, 'String', num2str(data.P0(4,1)) );
set(handles.P42, 'String', num2str(data.P0(4,2)) );
set(handles.P43, 'String', num2str(data.P0(4,3)) );
set(handles.P44, 'String', num2str(data.P0(4,4)) );
set(handles.P45, 'String', num2str(data.P0(4,5)) );
set(handles.P46, 'String', num2str(data.P0(4,6)) );
set(handles.P51, 'String', num2str(data.P0(5,1)) );
set(handles.P52, 'String', num2str(data.P0(5,2)) );
set(handles.P53, 'String', num2str(data.P0(5,3)) );
set(handles.P54, 'String', num2str(data.P0(5,4)) );
set(handles.P55, 'String', num2str(data.P0(5,5)) );
set(handles.P56, 'String', num2str(data.P0(5,6)) );
set(handles.P61, 'String', num2str(data.P0(6,1)) );
set(handles.P62, 'String', num2str(data.P0(6,2)) );
set(handles.P63, 'String', num2str(data.P0(6,3)) );
set(handles.P64, 'String', num2str(data.P0(6,4)) );
set(handles.P65, 'String', num2str(data.P0(6,5)) );
set(handles.P66, 'String', num2str(data.P0(6,6)) );

set(handles.R_11, 'String', num2str(data.R(1,1)) );
set(handles.R_12, 'String', num2str(data.R(1,2)) );
set(handles.R_13, 'String', num2str(data.R(1,3)) );
set(handles.R_21, 'String', num2str(data.R(2,1)) );
set(handles.R_22, 'String', num2str(data.R(2,2)) );
set(handles.R_23, 'String', num2str(data.R(2,3)) );
set(handles.R_31, 'String', num2str(data.R(3,1)) );
set(handles.R_32, 'String', num2str(data.R(3,2)) );
set(handles.R_33, 'String', num2str(data.R(3,3)) );

set(handles.Q11, 'String', num2str(data.Q(1,1)) );
set(handles.Q12, 'String', num2str(data.Q(1,2)) );
set(handles.Q13, 'String', num2str(data.Q(1,3)) );
set(handles.Q14, 'String', num2str(data.Q(1,4)) );
set(handles.Q15, 'String', num2str(data.Q(1,5)) );
set(handles.Q16, 'String', num2str(data.Q(1,6)) );
set(handles.Q21, 'String', num2str(data.Q(2,1)) );
set(handles.Q22, 'String', num2str(data.Q(2,2)) );
set(handles.Q23, 'String', num2str(data.Q(2,3)) );
set(handles.Q24, 'String', num2str(data.Q(2,4)) );
set(handles.Q25, 'String', num2str(data.Q(2,5)) );
set(handles.Q26, 'String', num2str(data.Q(2,6)) );
set(handles.Q31, 'String', num2str(data.Q(3,1)) );
set(handles.Q32, 'String', num2str(data.Q(3,2)) );
set(handles.Q33, 'String', num2str(data.Q(3,3)) );
set(handles.Q34, 'String', num2str(data.Q(3,4)) );
set(handles.Q35, 'String', num2str(data.Q(3,5)) );
set(handles.Q36, 'String', num2str(data.Q(3,6)) );
set(handles.Q41, 'String', num2str(data.Q(4,1)) );
set(handles.Q42, 'String', num2str(data.Q(4,2)) );
set(handles.Q43, 'String', num2str(data.Q(4,3)) );
set(handles.Q44, 'String', num2str(data.Q(4,4)) );
set(handles.Q45, 'String', num2str(data.Q(4,5)) );
set(handles.Q46, 'String', num2str(data.Q(4,6)) );
set(handles.Q51, 'String', num2str(data.Q(5,1)) );
set(handles.Q52, 'String', num2str(data.Q(5,2)) );
set(handles.Q53, 'String', num2str(data.Q(5,3)) );
set(handles.Q54, 'String', num2str(data.Q(5,4)) );
set(handles.Q55, 'String', num2str(data.Q(5,5)) );
set(handles.Q56, 'String', num2str(data.Q(5,6)) );
set(handles.Q61, 'String', num2str(data.Q(6,1)) );
set(handles.Q62, 'String', num2str(data.Q(6,2)) );
set(handles.Q63, 'String', num2str(data.Q(6,3)) );
set(handles.Q64, 'String', num2str(data.Q(6,4)) );
set(handles.Q65, 'String', num2str(data.Q(6,5)) );
set(handles.Q66, 'String', num2str(data.Q(6,6)) );






% --- Executes during object creation, after setting all properties.
function xstart_CreateFcn(hObject, eventdata, handles)
% hObject    handle to xstart (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, change
%       'usewhitebg' to 0 to use default.  See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function xstart_Callback(hObject, eventdata, handles)
% hObject    handle to xstart (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 xstart as text
%        str2double(get(hObject,'String')) returns contents of xstart as a double
temp = str2double(get(hObject, 'String'));
if isnan(temp)
   set(hObject, 'String', 0);
   errordlg('Input must be a number','Error');
end





% --- Executes during object creation, after setting all properties.function ystart_CreateFcn(hObject, eventdata, handles)% hObject    handle to ystart (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 ystart_Callback(hObject, eventdata, handles)% hObject    handle to ystart (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 ystart as text%        str2double(get(hObject,'String')) returns contents of ystart as a doubletemp = str2double(get(hObject, 'String'));
if isnan(temp)
   set(hObject, 'String', 0);
   errordlg('Input must be a number','Error');
end


% --- Executes during object creation, after setting all properties.function zstart_CreateFcn(hObject, eventdata, handles)% hObject    handle to zstart (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 zstart_Callback(hObject, eventdata, handles)% hObject    handle to zstart (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 zstart as text%        str2double(get(hObject,'String')) returns contents of zstart as a doubletemp = str2double(get(hObject, 'String'));
if isnan(temp)
   set(hObject, 'String', 0);
   errordlg('Input must be a number','Error');
end






% --- Executes during object creation, after setting all properties.
function velocity_CreateFcn(hObject, eventdata, handles)
% hObject    handle to velocity (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, change
%       'usewhitebg' to 0 to use default.  See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


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

temp = str2double(get(hObject, 'String'));
if isnan(temp)
   set(hObject, 'String', 0);
   errordlg('Input must be a number','Error');
end





% --- Executes during object creation, after setting all properties.function y_amp_CreateFcn(hObject, eventdata, handles)% hObject    handle to y_amp (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 y_amp_Callback(hObject, eventdata, handles)

⌨️ 快捷键说明

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