.mat file w/ vertices of 3D image inputted into axes in GUI

1 次查看(过去 30 天)
I have a GUI with an axes box, and I have a file V.mat which contains the vertices of a 3D image. How do I make this 3D image show up in the axes?
  3 个评论
Golnar
Golnar 2014-3-27
"a point cloud" [x, y, z] of a pressure ulcer, obtained by projecting Structured Light patterns on a wound and capturing via webcam the distortions in the pattern

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2014-3-27
pointsize = 20; %adjust as needed
scatter3(V.mat(:,1), V.mat(:,2), V.mat(:,3), pointsize)
However I am confused now about whether it is [x, y, z] coordinates, or if it is "0's and 1's": if it is 0's and 1's then it is not clear what the x y or z values would be.
  6 个评论
Walter Roberson
Walter Roberson 2014-3-28
编辑:Walter Roberson 2014-3-28
You had posted "V.mat is a 49358 x 3 matrix of 0's and 1's" so yes, I did mean V.mat
Perhaps what you meant was that the file V.mat contains a variable that has that structure. If so then we would need to know the name of the variable in order to code appropriately. You can use
whos -file V.mat
in order to see the list of variables in the file.
With regards to loading the data in one place and plotting it in another:
I still don't understand how your (x,y,z) and color are to relate together to be plotted.

请先登录,再进行评论。

更多回答(1 个)

Joseph Cheng
Joseph Cheng 2014-3-28
From your screenshot you will not be able to do it there. Are you trying to plot this when it opens? Push of a button?
Where ever you are trying to do this you need to do something like this
handles.axes1; %handles. (tag of the axes)
pointsize=20;
scatter3(V(:,1),V(:,2),V(:,3),pointsize);
now depending on where you want to do this you'll need to do it when V is defined.
When/where do you want to plot the scatter? and when/where/how is V.mat loaded?
  8 个评论
Golnar
Golnar 2014-3-28
编辑:Walter Roberson 2014-3-28
Joseph, I'm waiting on some more files before attempting to run it through the GUI. For now I'm going to just manually try and get the plot.
pointsize=20;
scatter3(V(:,1),V(:,2),V(:,3),pointsize);
returns this:
I have a COLOR.mat and an index.mat file as well that I'm now thinking relate to making this work. This is COLOR:
This is index.mat (just 1-49358):
Joseph Cheng
Joseph Cheng 2014-3-28
oh ok, check back when you get more stuff. i just wasn't sure what type of 3d plot with that much data and i see you only had 3 unique points.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Exploration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by