7-3 �H�R�O�C�i��ϧΪ%

§Ú­Ì¤]¥i¥H¨Ï¥Î«ü¥O¦Cªº¤è¦¡¨Ó§ïÅܤ@­Ó¹Ï§Îªº¦UºØ©Ê½è¡A³Ì±`¥Î¨ìªº¬O set »P get «ü¥O¡A¨ä¤¤ set «ü¥O¥i¥Î¨Ó³]©w¬Y­Ó©Ê½èªº­È¡A¦Ó get «ü¥O«h¥Î¨Ó©ó¨ú±o¬Y­Ó©Ê½èªº­È¡C¡]¨Æ¹ê¤W©Ò¦³¥HGUI¤¶­±¨Ó¶i¦æ¹Ï§Î­×§ïªº¤u¨ã¡A¤]³£¬O¨Ï¥Î³o¨â­Ó«ü¥O¨Ó§¹¦¨¡C¡^

¦b¤U¦C½d¨Ò¤¤¡A§Ú­Ì¥ý²£¥Í¤@±ø¦±½u¡A¦A¨Ï¥Î set «ü¥O¨Ó­×§ï¦¹¦±½uªº¦UºØ©Ê½è¡A¦p¤U¡G

Example 1: 07-´¤§â¦¡¹Ï§Î»PGUI³]­p/hg02.mt = 0:0.1:4*pi; y = exp(-t/5).*sin(t); h = plot(t, y); % h ¬°¦±½uªº´¤§â set(h, 'Linewidth', 3); % ±N¦±½u¼e«×§ï¬° 3 set(h, 'Marker', 'o'); % ±N¦±½uªº½u¼Ð§ï¦¨¤p¶ê°é set(h, 'MarkerSize', 20); % ±N½u¼Ðªº¤j¤p§ï¦¨ 20

§Ú­Ì¤]¥i¥H±N¤W­z¤T­Ó set «ü¥O¦X¦¨¤@­Ó«ü¥O¡G

set(h, 'LineWidth', 3, 'Marker', 'o', 'MarkerSize', 20);

¤]¥i¥H³æ¿W¨Ï¥Î set(h) ¨Ó¦C¥X h ©Ò¦³¥i¯àªº©Ê½è¡A¨Ò¦p¡G

Example 2: 07-´¤§â¦¡¹Ï§Î»PGUI³]­p/hgSet01.mh=plot(rand(1,10)); % h ¬°¦±½uªº´¤§â fprintf('MATLAB version = %s\n', version); set(h) % ¦C¥X h ªº©Ò¦³©Ê½èMATLAB version = 8.5.0.197613 (R2015a) AlignVertexCenters: {'on' 'off'} BusyAction: {'queue' 'cancel'} ButtonDownFcn: {} Children: {} Clipping: {'on' 'off'} Color: {1x0 cell} CreateFcn: {} DeleteFcn: {} DisplayName: {} HandleVisibility: {'on' 'callback' 'off'} HitTest: {'on' 'off'} Interruptible: {'on' 'off'} LineStyle: {'-' '--' ':' '-.' 'none'} LineWidth: {} Marker: {1x14 cell} MarkerEdgeColor: {'none' 'flat' 'auto'} MarkerFaceColor: {'none' 'flat' 'auto'} MarkerSize: {} Parent: {} PickableParts: {'visible' 'none' 'all'} Selected: {'on' 'off'} SelectionHighlight: {'on' 'off'} Tag: {} UIContextMenu: {} UserData: {} Visible: {'on' 'off'} XData: {} XDataMode: {'auto' 'manual'} XDataSource: {} YData: {} YDataSource: {} ZData: {} ZDataSource: {}

­Y±ý¨ú±o¬Y¤@­Ó©Ê½èªº­È¡A¥i¥Î get «ü¥O¡A¨Ò¦p¡A±ý¨ú±o h ªºÃC¦â¡A¥i¿é¤J¦p¤U¡G

get(h, 'Color')

­Y­n±oª¾ h ªº©Ò¦³©Ê½èªº­È¡A¥i¥Î get(h)¡A¨Ò¦p¡G

Example 3: 07-´¤§â¦¡¹Ï§Î»PGUI³]­p/hgGet01.mt=0:0.4:4*pi; h=plot(t, exp(-t/5).*sin(t)); % h ¬°¦±½uªº´¤§â set(h, 'Marker', 'diamond', 'MarkerSize', 15, 'MarkerFaceColor', 'r'); % ±N½u¼Ð§ï¦¨µÙ§Î¡B½u¼Ð¤j¤p§ï¦¨ 15¡B½u¼ÐªºÃä¦â§ï¦¨¬õ¦â fprintf('MATLAB version = %s\n', version); get(h) % ¦C¥X h ªº©Ò¦³©Ê½èMATLAB version = 8.5.0.197613 (R2015a) AlignVertexCenters: 'off' Annotation: [1x1 matlab.graphics.eventdata.Annotation] BeingDeleted: 'off' BusyAction: 'queue' ButtonDownFcn: '' Children: [] Clipping: 'on' Color: [0 0.4470 0.7410] CreateFcn: '' DeleteFcn: '' DisplayName: '' HandleVisibility: 'on' HitTest: 'on' Interruptible: 'on' LineStyle: '-' LineWidth: 0.5000 Marker: 'diamond' MarkerEdgeColor: 'auto' MarkerFaceColor: [1 0 0] MarkerSize: 15 Parent: [1x1 Axes] PickableParts: 'visible' Selected: 'off' SelectionHighlight: 'on' Tag: '' Type: 'line' UIContextMenu: [] UserData: [] Visible: 'on' XData: [1x32 double] XDataMode: 'manual' XDataSource: '' YData: [1x32 double] YDataSource: '' ZData: [1x0 double] ZDataSource: ''

¤W­z get ©M set ¥i¥H³q¥Î©ó MATLAB ¦UºØª©¥»¡A¦ý¬O¦^¶Çªºµ²ªG¨Ã¤£·|§¹¥þ¤@¼Ë¡A¦]¬°ÀHµÛ MATLAB ª©¥»ªº§ó·s¡A¨C¤@­Ó¹Ï§Îª«¥óªº©Ê½è³£·|¶V¨Ó¶V¦h¡C¡]¦]¦¹¦b¤W­z½d¨Ò¤¤¡A§Ú­Ì¯S§O¦L¥X°õ¦æ¦¹µ{¦¡©Ò¥Îªº MATLAB ª©¥»¡C¡^

¤@¯ë¦Ó¨¥¡A¨C¤@­Ó¹Ï§Îª«¥óªº©Ê½è³£¦³¼Æ¤QºØ¤§¦h¡A¦ý¯u¥¿±`¥Î¨ìªº©Ê½è¤j·§¤£¨ì¤QºØ¡C

¥t¤@­Ó±`¥Î¨ìªº«ü¥O¬O findobj¡A¬°¡ufind objects¡vªºÂ²ºÙ¡A¦¹«ü¥O¥i¦b´¤§â¦¡¹Ï§Îªº¶¥¼h¦¡µ²ºc¤¤¡A§ä¥X±z­nªºª«¥ó¡C¨Ò¦p¡A±ý§ä¤@­Ó¹Ï§Îµøµ¡¤ºªº©Ò¦³¦±½uª«¥ó¡A¥i¥é³y¤U¦C½d¨Ò¡G

Example 4: 07-´¤§â¦¡¹Ï§Î»PGUI³]­p/findobj01.mplot(rand(10, 2)); % µe¥X¨â±ø¦±½u h=findobj(0, 'type', 'line') % §ä¥X¦±½uªº´¤§â set(h, 'LineWidth', 3); % ¸g¥Ñ´¤§â±N¦±½u¼e«×§ï¬° 3 h = 2x1 <a href="matlab:helpPopup matlab.graphics.chart.primitive.Line" style="font-weight:bold">Line</a> array: Line Line

¦b¤W¨Ò¤¤²Ä¤G­Ó±Ô­z¤¤¡A¡u0¡v¥Nªí MATLAB ®à­±¡A¦]¦¹¤W¨Òªº¤G¡B¤T¦C±Ô­zªº·N¸q¬°¡u§ä¥X©Ò¦³«¬ºA¬° line ªºª«¥ó¡A¨Ã±N¨ä¦±½u¼e«×§ï¬° 3¡v¡A¶Ç¦^ªº¦V¶q h ªø«×¬° 2¡A¥Nªí¦@§ä¨ì¨â­Ó«¬ºA¬° line ªºª«¥ó¡C

Hint
¦b¤W­z½d¨Ò¤¤¡Ah(1) ©M h(2) ¤À§O¬O¨â±ø¦±½uªº´¤§â¡A¦ý¬O¥¦­Ìªº¼Æ­È¡A¥u¬O¥Î¨Ó¥Nªí¦¹´¤§â¡A¥»¨­¨Ã¨S¦³¤j¤p©Î¥¿­t¤è­±ªº¥ô¦ó»P¼Æ¦r¬ÛÃöªº·N¸q¡C


MATLABµ{¦¡³]­p¡G¤Jªù½g