function t = mpoint(p,scl,color) % % MPOINT creates a sphere object % P is the location of of the sphere % SCL is the size of the sphere % COLOR is the color of the sphere % [x, y, z] = sphere(20); h = surface(x,y,z,'FaceColor',color); % Create group object and parent surfaces t = hgtransform('Parent',gca); set(h,'Parent',t); T = makehgtform('translate',p); S = makehgtform('scale',scl); set(t,'Matrix',T*S);