2014-02-13 117 views
-2

我想我的可视化矩阵与矩阵的计算的平均值。 我要绘制该点,平均在同一窗口。如何绘制n维矩阵?

这里是我的矩阵,平均

Input=4 1 1 
     3 9 0 
     2 5 5] 
    Average=mean(Input 

如何绘制它?

要普洛特图我使用这个命令:

 plot(InputMatrix(:,:,:),Average'*'); 

有9分,但我只需要从矩阵3分和1分的意思......

 1st point from -->4 3 2 
     2nd point from -->1 9 0 
     3rd point from -->1 0 5 
     the 4th point is -->the mean/average 
+0

您的数据代表什么?它是3D吗?你想让你的情节看起来像什么? – Dan

+0

我有3x3矩阵,我只是想用平均来绘制它..以显示点的平均值附近分布.. – user3303896

+0

什么样的阴谋???一个图像?三点散点图?条形图? – Dan

回答

0

你可以使用plot3

plot3(Input(1,:),Input(2,:),Input(3,:),'o') %// plot each point (in 3D) 
hold on 
m = mean(Input,2); %// compute mean of all points 
plot3(m(1),m(2),m(3),'*') %// plot the mean 
+0

如果我有很多点,所以在“plot3” 命令,我必须写 “输入(1,:),...,输入(N,:), '^')”。 plot3(M(1),...,M(n)时, '*')。是不是? – user3303896