声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 5401|回复: 9

[经典算法] 知xyz坐标数据怎么绘成三维图

[复制链接]
发表于 2009-6-5 22:36 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
现在知道xyz坐标的数据
怎么回成三维图啊?
急急急!!!
谢谢

数据.txt

3.46 KB, 下载次数: 30

回复
分享到:

使用道具 举报

发表于 2009-7-9 12:13 | 显示全部楼层
a=load('数据.txt');
plot3(a(:,1),a(:,2),a(:,3))

评分

1

查看全部评分

发表于 2009-7-10 10:37 | 显示全部楼层
画点可以,要是面的话有通用算法吗?稍后我也要面对这个问题
发表于 2009-8-3 17:20 | 显示全部楼层
load w.dat;
xline=linspace(0,0.1,30);
yline=linspace(0,0.1,30);
[X,Y]=meshgrid(xline,yline);
Z=griddata(w(:,1),w(:,2),w(:,3),X,Y);
surf(Y,X,Z);

评分

1

查看全部评分

发表于 2009-8-3 22:33 | 显示全部楼层
楼上的稍作修饰
load w.dat;
maxX=max(w(:,1)); minX=min(w(:,1));
maxY=max(w(:,2)); minY=min(w(:,2));
xline=linspace(minX,maxX,30);
yline=linspace(minY,maxY,30);
[X,Y]=meshgrid(xline,yline);
Z=griddata(w(:,1),w(:,2),w(:,3),X,Y);
surf(Y,X,Z);
发表于 2010-7-18 12:07 | 显示全部楼层

回复 5楼 ChaChing 的帖子

我有一组数据:w=[-0.298809,0.913112,-0.371000,
-0.124810,0.652112,-0.024000,
-0.298809,0.391113,0.085000,
-0.298809,0.130113,0.107000,
-0.298809,0.065113,0.085000,
-0.298809,-0.369887,0.210000,
-0.298809,-0.412887,0.124000,
-0.298809,-0.564888,0.142000,
-0.298809,-0.673888,0.150000,
-0.298809,-0.738888,0.107000,
-0.298809,-0.999888,0.063000,
-0.081810,0.891112,-0.371000,
0.158190,0.761112,-0.328000,
0.136190,0.478112,-0.111000,
0.311191,0.391113,-0.328000,
0.223190,0.130113,-0.111000,
0.092190,0.226113,0.030000,
-0.168810,0.130113,0.107000,
0.092190,0.174113,0.030000,
0.005190,0.077113,-0.002000,
0.171190,0.000113,-0.111000,
0.005190,0.056113,0.000000,
0.005190,-0.025887,0.000000,
-0.168810,0.000113,0.000000,
0.005190,-0.043887,0.000000,
-0.189810,-0.304887,0.037000,
-0.124810,-0.391887,0.037000,
0.088190,-0.247887,-0.045000,
0.251190,-0.397887,-0.328000,
0.310191,0.000113,-0.328000,
0.171190,-0.747888,-0.328000,
-0.052810,-0.608888,0.000000,
-0.124810,-0.956888,0.000000,
-0.255809,-0.543888,0.150000,
-0.472810,0.652112,-0.024000,
-0.298809,0.391113,0.085000,
-0.298809,0.130113,0.107000,
-0.298809,0.065113,0.085000,
-0.298809,-0.369887,0.210000,
-0.298809,-0.412887,0.124000,
-0.298809,-0.608888,0.124000,
-0.298809,-0.673888,0.150000,
-0.298809,-0.738888,0.107000,
-0.298809,-0.999888,0.063000,
-0.515810,0.891112,-0.371000,
-0.755809,0.761112,-0.328000,
-0.733810,0.478112,-0.111000,
-0.908809,0.391113,-0.328000,
-0.820809,0.130113,-0.111000,
-0.689810,0.226113,0.030000,
-0.428810,0.130113,0.107000,
-0.689810,0.174113,0.030000,
-0.602810,0.077113,-0.002000,
-0.768809,0.000113,-0.111000,
-0.602810,0.056113,0.000000,
-0.602810,-0.025887,0.000000,
-0.428810,0.000113,0.000000,
-0.602810,-0.043887,0.000000,
-0.407809,-0.304887,0.037000,
-0.472810,-0.391887,0.037000,
-0.685810,-0.247887,-0.045000,
-0.848809,-0.397887,-0.328000,
-0.907809,0.000113,-0.328000,
-0.768809,-0.747888,-0.328000,
-0.544810,-0.608888,0.000000,
-0.472810,-0.956888,0.000000,
-0.341809,-0.543888,0.150000,
0.049190,0.052113,-0.030000,
0.049190,-0.032887,-0.030000,
-0.646810,0.052113,-0.030000,
-0.646810,-0.032887,-0.030000,
-0.033810,0.052113,-0.030000,
-0.033810,-0.032887,-0.030000,
-0.563810,0.052113,-0.030000,
-0.563810,-0.032887,-0.030000,
-0.218809,-0.367887,0.150000,
-0.378809,-0.367887,0.150000,
-0.276809,0.065113,0.063000,
-0.320809,0.065113,0.063000,
-0.175809,-0.557888,0.063000,
-0.421809,-0.557888,0.063000,
-0.198809,-0.608888,0.050000,
-0.398809,-0.608888,0.050000,
-0.198809,-0.608888,0.050000,
-0.398809,-0.608888,0.050000,
-0.175809,-0.655888,0.063000,
-0.421809,-0.655888,0.063000,
-0.298809,-0.608888,0.124000,
-0.098810,-0.608888,-0.024000,
-0.498810,-0.608888,-0.024000,
0.058190,-0.608888,-0.050000,
-0.655810,-0.608888,-0.050000,
-0.233809,-0.119887,0.050000,
-0.363809,-0.119887,0.050000,
-0.298809,-0.079887,0.100000,
0.088190,0.053113,-0.056000,
-0.685810,0.053113,-0.056000,
0.088190,0.038113,-0.056000,
-0.685810,0.038113,-0.056000,
0.088190,-0.021887,-0.056000,
-0.685810,-0.021887,-0.056000,
0.088190,-0.030887,-0.067000,
-0.685810,-0.030887,-0.067000,
-0.081810,0.053113,-0.013000,
-0.515810,0.053113,-0.013000,
-0.081810,0.038113,-0.013000,
-0.515810,0.038113,-0.013000,
-0.081810,-0.021887,-0.013000,
-0.515810,-0.021887,-0.013000,
-0.081810,-0.030887,-0.024000,
-0.515810,-0.030887,-0.024000,
-0.178810,-0.412887,0.100000,
-0.418809,-0.412887,0.100000]
请您帮忙看看是否可以通过径向基函数插值出3维面
不胜感激
发表于 2010-7-18 17:41 | 显示全部楼层

回复 6楼 吴松 的帖子

径向基函数插值? 不明白
发表于 2010-7-18 18:07 | 显示全部楼层

回复 7楼 ChaChing 的帖子

通过三维插值来画出这些数据得三维平面图可以不啊?
发表于 2010-7-18 23:18 | 显示全部楼层

回复 8楼 吴松 的帖子

5F不是给了代码?:loveliness:
发表于 2011-4-8 11:29 | 显示全部楼层
学习了,plot3可以画三维曲线,再修饰下就行
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-10 17:24 , Processed in 0.070980 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表