4D plot using 3D array

3 views (last 30 days)
Andriana
Andriana on 8 Sep 2014
Commented: Andriana on 8 Sep 2014
Hey!
I have an 128x128x128 array C(128,128,128) filled with positive integers. I need to make a 3D scatter plot, where my array indices (i,j,k) will correspond to x,y,z coordinates and the value of each array element C(i,j,k) will determine its corresponding point colour. Any ideas on how I can accomplish that?

Accepted Answer

Sean de Wolski
Sean de Wolski on 8 Sep 2014
I would use slice() (or maybe an isosurface) to slice it across various planes. A 3d scatter plot that size will look like a cubic blob.
  3 Comments
Sean de Wolski
Sean de Wolski on 8 Sep 2014
In that case:
[xx,yy,zz] = meshgrid(1:128); % build grid
scatter3(xx(:),yy(:),zz(:),C(:))
Andriana
Andriana on 8 Sep 2014
thank you!I almost got what I wanted! :)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!