Giao trình thí nghiệm cad

Page 54

Giáo trình thí nghiệm CAD

h Tạo nút Sphere để vẽ một hình cầu 3D: Nhập tiếp nội dung sau vào file giaodien.m % ---------------------------------------------------------------------------------% Sphere button sph=uicontrol( ... 'Style','pushbutton', ... 'Units','normalized', ... 'Position',[p1+0.01 p4-0.05 p3-0.025 0.05], ... 'String','Sphere', ... 'Foregroundcolor','b',... 'Fontsize',9,... 'Callback',['[x,y,z]=sphere(35);', 'surfl(x,y,z);', 'axis equal']); Lưu và thi hành file này.

(Hình 6.7)

i Tạo nút Picture để hiển thị ảnh màu: Nhập tiếp nội dung sau vào file giaodien.m % ---------------------------------------------------------------------------------% Picture button pic=uicontrol( ... 'Style','pushbutton', ... 'Units','normalized', ... 'Position',[p1+0.01 p4-0.125 p3-0.025 0.05], ... 'String','Picture', ... 'Foregroundcolor','b',... 'Fontsize',9,... 'Callback',['imshow(imread(''flowers.tif''))']); © TcAD - 2003

54


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.