figure
subplot(2,3,1)
ezplot(@sin)
xlabel('time')
ylabel('sin')
subplot(2,3,5)
ezplot(@cos)
subplot(2,3,[3,6])
subplot(2,4,[3,8])
y=round(rand(5,3)*10)
y =
8 1 2
9 3 10
1 5 10
9 10 5
6 10 8
subplot(1,2,1)
bar(y)
set(gca,'xticklabel',{'A','B','C1','D2','E'})
subplot(1,2,2)
bar(y,0.5)
bar(y,'stacked')
h=bar(y,'stacked');
set(h(1),'facecolor','m','edgecolor','k','linewidth',2)
set(h(2),'facecolor','g','linestyle','none')
bar3(y)
x= [2,4,8,1,0.5];
pie(x)
flag=[0,0,1,0,0];
pie(x,flag)
flag=[0,0,1,0,1];
pie(x,flag)
pie3(x,flag)
x=0:0.5:2*pi;
y=sin(x);
area(x,y)
h=area(x,y);
h.FaceColor ='r';
h.EdgeColor ='m';
h.LineWidth =3;
x=[2,4,5,1];
y=[4,5,2,1];
fill(x,y,'g')
x=0:0.5:2*pi;
y1=sin(x)+2;
y2=cos(x)-2;
xfill=[x,fliplr(y)];
xfill=[x,fliplr(x)];
yfill=[y1,fliplr(y)];
yfill=[y1,fliplr(y2)];
fill(xfill,yfill,'r')
z=normrnd(0,100,1000,1);
hist(z)
hist(z,[-300:20:-40,-20:5:20,40:20:300])
% Kuroshio.mat
y=rand(1000,1)*2*pi;
rose(y)
v=rand(144,1)*10+5;
u=rand(144,1)*10-5;
ang=atan(v./abs(u));
ang(u<0)=pi-ang(u<0);
rose(ang)
clear
% load seamount.mat
% h =scatter(x,y,5,z);
% colorbar
% h.Maker='v';
% h =scatter(x,y,5,z,'filled');
% load penny.mat
x=linspace(1,10,128);
y=x;
% contour(x,y,P)
% contour(x,y,flipud(P),60)
% axis square;colormap('copper')
clear
[x,y]=meshgrid(-2:0.2:2,-3:0.2:2);
z=x.*exp(-x.^2-y.^2);
[c,h]=contour(x,y,z);
clabel(c,h)
[c,h]=contourf(x,y,z);
[c,h]=contourf(x,y,z,20);
colormap('spring')
colorbar
[c,h]=contourf(x,y,z,20);
ap('autumn')
colormap('jet')
caxis([-0.4,0.4])
pcolor(x,y,z)
shading flat
shading interp
colorbar
[dx,dy]=gradient(z);
[dx,dy]=gradient(z,0.2,0.2);
contour(x,y,z)
hold on
quiver(x,y,dx,dy)
hold off
x=0:0.5:2*pi;
u=sin(x);
v=cos(x);
feather(u,v)
[x,y]=meshgrid(-2:0.2:2,-3:0.2:2);
surf(x,y,z)
shading flat
shading interp
surfc(x,y,z)
mesh(x,y,z)
meshc(x,y,z)
set(gcf,'PaperPositionMode','auto')
print('-djpeg','-r300','fig1')
print('-dtiff','-r300','fig1')
print('-dpdf','fig1')