(在线等)已知一系列散点,用matlab绘制三维图形,并插值
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/12 21:47:09
(在线等)已知一系列散点,用matlab绘制三维图形,并插值
已知一系列散点,坐标(x,y,z)分别为:(-6 6 41.1),(-3 6 7.9),(3 6 20.7),(6 -6 41.1),
(-6 3 40.5),(-3 3 42.8),(3 3 43),(6 3 43.1),(-6 -3 40.5),(-3 -3 42.3),(3 -3 41.9),
(6 -3 44),(-6 -6 42.9),(-3 -6 42.1),(3 -6 42.2),(6 -6 42.6),求一段matlab程序,用这些散点绘制三维图形,并且用这些点进行插值,
已知一系列散点,坐标(x,y,z)分别为:(-6 6 41.1),(-3 6 7.9),(3 6 20.7),(6 -6 41.1),
(-6 3 40.5),(-3 3 42.8),(3 3 43),(6 3 43.1),(-6 -3 40.5),(-3 -3 42.3),(3 -3 41.9),
(6 -3 44),(-6 -6 42.9),(-3 -6 42.1),(3 -6 42.2),(6 -6 42.6),求一段matlab程序,用这些散点绘制三维图形,并且用这些点进行插值,
A=[-6 6 41.1;-3 6 7.9;3 6 20.7;6 -6 41.1;-6 3 40.5;-3 3 42.8;3 3 43;6 3 43.1;
-6 -3 40.5;-3 -3 42.3;3 -3 41.9;6 -3 44;-6 -6 42.9;-3 -6 42.1;3 -6 42.2;6 -6 42.6]
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))',linspace(min(y),max(y)),'v4');%插值
pcolor(X,Y,Z);shading interp%伪彩色图
figure,contourf(X,Y,Z) %等高线图
figure,surf(X,Y,Z)%三维曲面
-6 -3 40.5;-3 -3 42.3;3 -3 41.9;6 -3 44;-6 -6 42.9;-3 -6 42.1;3 -6 42.2;6 -6 42.6]
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))',linspace(min(y),max(y)),'v4');%插值
pcolor(X,Y,Z);shading interp%伪彩色图
figure,contourf(X,Y,Z) %等高线图
figure,surf(X,Y,Z)%三维曲面