.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?
采纳的回答
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
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
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 个评论
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 Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!