??? Error using ==> plot3 Not enough input arguments。

% 程序功能 :采用JPDA数据关联算法实现两个交叉匀速运动目标的点迹与航迹的关联
%
clc;
clear all;
close all;
Mc_Number=10; % 蒙特卡洛仿真次数
N=50; % 观测数据点数
c=2; % 跟踪目标个数
T=1; % 采样时间1s
A=[1 T 0 0;0 1 0 0;0 0 1 T;0 0 0 1]; % 状态转移矩阵
H=[1 0 0 0;0 0 1 0]; % 量测转移矩阵
X01=[-29500;400;34500;-400]; % 目标1的初始位置
X02=[-27250;296;34500;-400]; % 目标2的初始位置
sigma_v=100; % 量测标准差
R=[1 0;0 1]*sigma_v^2; % 噪声协方差矩阵
P0=[1 1/T 0 0;
1/T 2/T^2 0 0;
0 0 1 1/T;
0 0 1/T 2/T^2]*sigma_v^2; % 初始协方差矩阵
X_Measurement=zeros(4,c,N); % 各个目标的实际位置
Z_Measurement=zeros(2,c,N); % 各个目标的观测数据值
X_McFilter=zeros(4,c,N,Mc_Number); % Mc_Number仿真滤波值
X_Filter=zeros(4,c,N); % 存储各个目标的滤波值
%X_Measurement(:,:,1)=[X01 X02];
for j=1:c
for i=1:N
if i==1
X_Measurement(:,:,i) = [X01 X02];
else
X_Measurement(:,j,i) = A*X_Measurement(:,j,i-1);
end
Z_Measurement(:,j,i) = H*X_Measurement(:,j,i) + sigma_v*randn(2,1);
end
end
figure(1)
plot(X_Measurement(1,1,:),X_Measurement(3,1,:),'LineWidth',1.5);
grid on
为什么画不出二维图形出来? 有错误提示为:
??? Error using ==> plot
Data may not have more than 2 dimensions.

 採用された回答

0 投票

画图语句换成
plot(squeeze(X_Measurement(1,1,:)),squeeze(X_Measurement(3,1,:)),'LineWidth',1.5);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCOM Component Integration についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!