How can I plot a sphere when I know [x,y,z] coordinates of points belonging to the sphere?

Dear mathworks users, I have a serie of point coordinates (matrix size Nx3) which belong to the sphere. How can I plot it with maltab? I am not able to find any surf and meshgrid combination for use.
And finally, my data are a spherical function and each point has its own intensity value. So I need to add color based on intensity value to each point. The intensity outside the points should be interpolated based on control points.
Thanks for help. Rene

Answers (1)

pointsize = 20;
scatter3(x(:), y(:), z(:), pointsize, intensity(:))

1 Comment

I was looking on scatter3 function too. But it is not exactly what I want and need.
pointsize = 500;
scatter3(G(:,1), G(:,2), G(:,3), pointsize, DW_int_ban(:))
Result:
The visualization should like something like this:
I am afraid I will have to define faces for points in triangular net and then use trisurf. But I still bealive that easier way exists.
If somebody would be interested. Points (G) and intensity values (I) are attached in file data.mat.

Sign in to comment.

Asked:

on 18 Sep 2015

Commented:

on 18 Sep 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!