球面上的分散数据可视化MATLAB [英] visualization of scattered data over a sphere surface MATLAB

查看:119
本文介绍了球面上的分散数据可视化MATLAB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个3D有限元代码,并且在球体表面上的一堆分散数据(x,y,z)上具有函数C(x,y,z)(在FEM中为FOUND)的值.我正在尝试在MATLAB上使用 surf 可视化该函数,并且我已经使用 griddata 在球体表面上插值函数C,但是它不起作用,我面对以下问题:

I wrote a 3D finite element code and I have the values of the function C(x,y,z) (FOUND in FEM) on a bunch of scattered data (x,y,z) over a surface of the sphere. I'm trying to visualize the function using surf on MATLAB and I already used griddata to interpolate the function C over the surface of a sphere, however it does not work and I face with the following problem:

警告:检测到重复的x-y数据点:使用z的平均值值

Warning: Duplicate x-y data points detected: using average of the z values

最后我看到的最终图形只是球形的一小部分.

and the ultimate figure I see at the end is just a poor section of sphere.

推荐答案

如果您查看

If you look at the example given in the matlab documentation for plotting things on a sphere, you will see (among other things) the following lines of code:

k = 5;
n = 2^k-1;
[x,y,z] = sphere(n);
c = hadamard(2^k);
surf(x,y,z,c);
colormap([1  1  0; 0  1  1])
axis equal

在这种情况下,表面上的点由它们的(x,y,z)系数定义,颜色由矩阵 c 和颜色映射 [1 1 0;0 1 1] .您所描述的错误表明您使用的是 surf(x,y,z)而不是 surf(x,y,z,c)来创建绘图.如果您学习上面引用的文档,则可能可以使上面的内容适应您的情况-在没有更多有关数据的信息的情况下,很难猜测出一个更好的答案.

In this case the points on the surface are defined by their (x, y, z) coefficients, and the color is determined by the matrix c and the colormap [1 1 0; 0 1 1]. The error you describe suggests you are using surf(x,y,z) rather than surf(x,y,z,c) to create your plot. If you study the documentation referenced above you may be able to adapt the above to your situation - without a bit more information about your data it's hard to guess at a better answer.

这篇关于球面上的分散数据可视化MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆