A=xlsread('地址');
x=A(:,1);y=A(:,2);z=A(:,3);
scatter(x,y,5,z)%散点图一年级数学试卷上册
figure
[X,Y,Z]=griddata(x,y,z,linspace(min(x),max(x),200)',linspace(min(y),max(y),200),'v4');%插值
pcolor(X,Y,Z);shading interp%伪彩色图
figure,contourf(X,Y,Z) %等高线图
figure,surf(X,Y,Z)%三维曲面
和那个其实一样的,表格你们自己处理一下xls文件就行
clc
clear
clo all
D=load('ZuoBiao.dat');
M=load('JinShu.dat');
x=D(:,2);
y=D(:,3);
z=D(:,4);
c=D(:,5);
xi=linspace(min(x),max(x),100);
yi=linspace(min(y),max(y),100);
[xi,yi]=meshgrid(xi,yi);
zi=griddata(x,y,z,xi,yi);
ci=griddata(x,y,c,xi,yi);
marker={'*','o','s','^','p'};
color={'k','r','y','c','b'};
mat={'As','Cd','Cr','Cu','Hg','Ni','Pb','Zn'};
str={'等高线','生活区','工业区','山林区','交通区','绿地区'};
for j=1:8
加油努力的句子 % 等高线图形出国口语
figure
下划线怎么去掉 contourf(xi,yi,zi,0:10:500);
% t(h,'ShowText','on','TextStep',get(h,'LevelStep')*2)
% clabel(C,h,[0:10:50,50:50:300,300:100:500]);
title(['金属 ',mat{j}, ' 二维等高线分布图'])
xlabel('X')
ylabel('Y')
抱组词
colormap summer
colorbar
grid on
hold on
黑色的英文怎么写 for i=1:5
loc=c==i;
plot(x(loc),y(loc),marker{i},'markerfacecolor',color{i},'MarkerEdgeColor',color{i});
end
legend(str,'location','best')
for k=1:length(x)
指付通 text(x(k)-200,y(k)+200,num2str(M(k,j+1)),'fontsize',8);
end
end
日月潭的传说% 三维体图
figure
h=surf(xi,yi,zi);
t(h,'cdata',ci);
colormap hsv
title('三维图立体(颜色条表示分类)')
xlabel('X')
ylabel('Y')
colorbar
hidden off
hold on
for i=1:5
loc=c==i;
plot3(x(loc),y(loc),z(loc),marker{i},'markerfacecolor',color{i});
end
str{1}='三维图';
legend(str,'location','best')