文档介绍:基于MATLAB的数据处理与统计作图概要
基于MATLAB的数据处理与统计作图概要
1 / 16
基于MATLAB的数据处理与统计作图概要
Smooth 函数:
load ;
c=smo;
y=y+noise;
subplot(1,2,1);plot(x,y);
yy=medfilt1(y,50);
subplot(1,2,2);plot(x,y,'r-.');
hold on;plot(x,yy,'.');
基于MATLAB的数据处理与统计作图概要
基于MATLAB的数据处理与统计作图概要
3 / 16
基于MATLAB的数据处理与统计作图概要
直方图:
Hist 函数:
x=randn(499,1);
y=randn(499,3);
subplot(3,1,1);hist(x);
subplot(3,1,2);hist(x,100);
subplot(3,1,3);hist(y,25);
基于MATLAB的数据处理与统计作图概要
基于MATLAB的数据处理与统计作图概要
4 / 16
基于MATLAB的数据处理与统计作图概要
Histc 函数:
x=-::;
y=randn(10000,1);
subplot(1,2,1);hist(y,x);
n=histc(y,x);
c=cumsum(n);
subplot(1,2,2);bar(x,c);
Histfit 函数:
r=normrnd(10,1,10,1);
histfit(r);
h=get(gca,'Children');
基于MATLAB的数据处理与统计作图概要
基于MATLAB的数据处理与统计作图概要
5 / 16
基于MATLAB的数据处理与统计作图概要
盒子图:
N=1024;x1=normrnd(5,1,N,1);
x2=normrnd(6,1,N,1);x=[x1 x2];subplot(2,2,1);sym1='*';notch1=1;boxplot(x,notch1,sym1);
subplot(2,2,2);notch2=0;boxplot(x,notch2);
x=randn(100,25);subplot(2,1,1);boxplot(x);
基于MATLAB的数据处理与统计作图概要
基于MATLAB的数据处理与统计作图概要
6 / 16
基于MATLAB的数据处理与统计作图概要
误差条图:
x=0:pi/10:pi;
y=sin(x);
e=std(y)*ones(size(x));
errorbar(x,y,e)
最小二乘法拟合直线:
x=1:10;
y1=x+rand(1,10);
scatter(x,y1,25,'b','*')
hold on;
y2=2*x+randn(1,10);
plot(x,y2,'mo')
y3=3*x+randn(1,10);
plot(x,y3,'rx:');
y4=4*x+randn(1,10);
plot(x,y4,'g+--');
基于MATLAB的数据处理与统计作图概要
基于MATLAB的数据处理与统计作图概要
7 / 16
基于MATLAB的数据处理与统计作图概要