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

📄 target_tracking_simulation.m

📁 使用卡尔曼滤波进行目标追踪的matlab源代码
💻 M
字号:
function varargout = Target_Tracking_Simulation(varargin)% TARGET_TRACKING_SIMULATION M-file for Target_Tracking_Simulation.fig%      TARGET_TRACKING_SIMULATION, by itself, creates a new TARGET_TRACKING_SIMULATION or raises the existing%      singleton*.%%      H = TARGET_TRACKING_SIMULATION returns the handle to a new TARGET_TRACKING_SIMULATION or the handle to%      the existing singleton*.%%      TARGET_TRACKING_SIMULATION('Property','Value',...) creates a new TARGET_TRACKING_SIMULATION using the%      given property value pairs. Unrecognized properties are passed via%      varargin to Target_Tracking_Simulation_OpeningFcn.  This calling syntax produces a%      warning when there is an existing singleton*.%%      TARGET_TRACKING_SIMULATION('CALLBACK') and TARGET_TRACKING_SIMULATION('CALLBACK',hObject,...) call the%      local function named CALLBACK in TARGET_TRACKING_SIMULATION.M with the given input%      arguments.%%      *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 Target_Tracking_Simulation% Last Modified by GUIDE v2.5 28-Jun-2005 16:21:59% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @Target_Tracking_Simulation_OpeningFcn, ...                   'gui_OutputFcn',  @Target_Tracking_Simulation_OutputFcn, ...                   'gui_LayoutFcn',  [], ...                   'gui_Callback',   []);if nargin & isstr(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 EDIT% --- Executes just before Target_Tracking_Simulation is made visible.function Target_Tracking_Simulation_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   unrecognized PropertyName/PropertyValue pairs from the%            command line (see VARARGIN)% Choose default command line output for Target_Tracking_Simulationhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes Target_Tracking_Simulation wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = Target_Tracking_Simulation_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;% --- Executes on button press in IMM.function IMM_Callback(hObject, eventdata, handles)% hObject    handle to IMM (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Get user input from GUIT = str2double(get(handles.T,'String'));if T-floor(T)>0    errordlg('T must be integer!');    error('input T is not integer!');endmont = str2double(get(handles.mont,'String'));if mont-floor(mont)>0    errordlg('mont must be integer!');    error('input mont is not integer!');endd = str2double(get(handles.d,'String'));% Calculate data[x,y,zx,zy,XXE,YYE,XERB,YERB,XSTD,YSTD]=IMM(T,mont,d);% plotaxes(handles.plotTrack);plot(zx,zy,'g',x,y,'r',XXE,YYE,'b');axis([1500 5000 -8000 11000]);title('IMM算法仿真');legend('观测数据','真实轨迹','滤波估计');axes(handles.meanX);plot(XERB)axis([0 500 -50 50])xlabel('观测次数n')title('E(X-Ximm)');axes(handles.stdX);plot(XSTD)axis([0 500 0 150])xlabel('观测次数n')title('Std(X-Ximm)')axes(handles.meanY);plot(YERB)axis([0 500 -50 50])xlabel('观测次数n')title('E(Y-Yimm)')axes(handles.stdY);plot(YSTD)axis([0 500 0 150])xlabel('观测次数n')title('Std(Y-Yimm)')% --- Executes on button press in LS.function LS_Callback(hObject, eventdata, handles)% hObject    handle to LS (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Get user input from GUIT = str2double(get(handles.T,'String'));if T-floor(T)>0    errordlg('T must be integer!');    error('input T is not integer!');endM = str2double(get(handles.mont,'String'));if M-floor(M)>0    errordlg('mont must be integer!');    error('input mont is not integer!');endd = str2double(get(handles.d,'String'));% Calculate data[x,y,zx,zy,XXE,YYE,XERB,YERB,XSTD,YSTD]=LS(T,M,d);% plotaxes(handles.plotTrack);plot(zx,zy,'g',x,y,'r',XXE,YYE,'b');axis([1500 5000 -8000 11000]);title('最小二乘算法仿真');legend('观测数据','真实轨迹','滤波估计');axes(handles.meanX);plot(XERB)axis([0 500 -500 500])xlabel('观测次数n')title('E(X-Xls)');axes(handles.stdX);plot(XSTD)axis([0 500 0 150])xlabel('观测次数n')title('Std(X-Xls)')axes(handles.meanY);plot(YERB)axis([0 500 -500 500])xlabel('观测次数n')title('E(Y-Yls)')axes(handles.stdY);plot(YSTD)axis([0 500 0 150])xlabel('观测次数n')title('Std(Y-Yls)')

⌨️ 快捷键说明

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