.mat file w/ vertices of 3D image inputted into axes in GUI
Show older comments
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 Comments
Walter Roberson
on 27 Mar 2014
What is a "3d image" for this purpose?
Golnar
on 27 Mar 2014
Golnar
on 27 Mar 2014
Accepted Answer
More Answers (1)
Joseph Cheng
on 28 Mar 2014
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 Comments
Joseph Cheng
on 28 Mar 2014
Also for clearification this is what you want to do can you paste in a screen shot of what V(1:10,:) looks like
Golnar
on 28 Mar 2014
Golnar
on 28 Mar 2014
Golnar
on 28 Mar 2014
Joseph Cheng
on 28 Mar 2014
then for simplicities sake
within the reset__callback after you load(V.mat):
load(V.mat);
handles.V = V; %store V within handles (dunno if this is best practices but i do it.
guidata(hObject, handles); %update handles globally so we can use it in another function.
in the calculate_callback(hObject, eventdata, handles, varargin)
V=handles.V; %don't have to do this but makes it shorter to type.
handles.axes1; %handles. (tag of the axes) : sets the active axes to the one you want to use.
pointsize=20; %set point size to 20
scatter3(V(:,1),V(:,2),V(:,3),pointsize); %scatter plot V data.
Joseph Cheng
on 28 Mar 2014
I do not know what type of plot you want for that type of data. Its definitely not a [x,y,z] unless the first 18 are just the same point. well if you figure out what type of plot/scatter/image/surface. just substitute scatter3 with what you're trying to do.
Golnar
on 28 Mar 2014
Edited: Walter Roberson
on 28 Mar 2014
Joseph Cheng
on 28 Mar 2014
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.
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






