One way to do it is to use the line
command. You specify the XYZ coordinates of the origin and then some length as the delta from the origin.
% origin
origin = [1 2 3];
% length of frame vectors
delta = 10;
% x-axis
line('XData', [origin(1) origin(1) + delta], 'YData', [origin(2) origin(2)],...
'ZData', [origin(3) origin(3)], 'Color','r');
% y-axis
line('XData', [origin(1) origin(1)], 'YData', [origin(2) origin(2) + delta],...
'ZData', [origin(3) origin(3)], 'Color','g');
% z-axis
line('XData', [origin(1) origin(1)], 'YData', [origin(2) origin(2)],...
'ZData', [origin(3) origin(3) + delta], 'Color','b');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.