> R function in Matlab?

I've got a function that assigns a real value to every point in space. How can I visualize it on some bounded volume?


To extend Peter's suggestion in the comments ^^:

use scatter3 with setting the cdata parameter:

% generating some sample data
[x,y,z]=sphere(50);
x=x(:);y=y(:);z=z(:);

% the interesting stuff:
h=scatter3(x,y,z);

gives you

scatter3

To add coloring, do the following:

set(h,'cdata',z)

or immediately:

scatter3(x,y,z,'cdata',z);

which results in

在这里输入图像描述

Here the color vector is just the z value, but it can be anything (as long as it's the same size as x (and y and z).

链接地址: http://www.djcxy.com/p/60092.html

上一篇: 有没有其他解决方案比黑客日期

下一篇: >在Matlab中的R函数?