>> %Creating the data >> A=zeros(100); >> for j=1:100;A(j,j)=1;A(j,100)=1;A(100,j)=1;end >> x=linspace(0,1,50); >> y=sin(2*pi*x*2)./(2*x+0.5); >> y10=10.^y; >> >> %Start of class >> >> help spy SPY Visualize sparsity pattern. SPY(S) plots the sparsity pattern of the matrix S. SPY(S,'LineSpec') uses the color and marker from the line specification string 'LineSpec' (See PLOT for possibilities). SPY(S,markersize) uses the specified marker size instead of a size which depends upon the figure size and the matrix order. SPY(S,'LineSpec',markersize) sets both. >> spy(A) >> h=get(gca,'children'); >> whos h Name Size Bytes Class h 1x1 8 double array Grand total is 1 elements using 8 bytes >> set(h,'linestyle','-') >> set(h,'linestyle','none','marker','o') >> get(gca) ALim = [0 1] ALimMode = auto AmbientLightColor = [1 1 1] Box = on CameraPosition = [50.5 50.5 1428.39] CameraPositionMode = auto CameraTarget = [50.5 50.5 0] CameraTargetMode = auto CameraUpVector = [0 -1 0] CameraUpVectorMode = auto CameraViewAngle = [8.08918] CameraViewAngleMode = auto CLim = [0 1] CLimMode = auto Color = [1 1 1] CurrentPoint = [ (2 by 3) double array] ColorOrder = [ (7 by 3) double array] DataAspectRatio = [0.5 0.5 1] DataAspectRatioMode = auto DrawMode = normal FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal GridLineStyle = none Layer = bottom LineStyleOrder = - LineWidth = [0.5] NextPlot = replace PlotBoxAspectRatio = [101 101 1] PlotBoxAspectRatioMode = manual Projection = orthographic Position = [0.13 0.11 0.775 0.815] TickLength = [0.01 0.025] TickDir = in TickDirMode = auto Title = [104.002] Units = normalized View = [0 90] XColor = [0 0 0] XDir = normal XGrid = off XLabel = [101.007] XAxisLocation = bottom XLim = [0 101] XLimMode = manual XScale = linear XTick = [0 20 40 60 80 100] XTickLabel = 0 20 40 60 80 100 XTickLabelMode = auto XTickMode = auto YColor = [0 0 0] YDir = reverse YGrid = off YLabel = [102.003] YAxisLocation = left YLim = [0 101] YLimMode = manual YScale = linear YTick = [ (1 by 11) double array] YTickLabel = [ (11 by 3) char array] YTickLabelMode = auto YTickMode = auto ZColor = [0 0 0] ZDir = normal ZGrid = off ZLabel = [103.004] ZLim = [-1 1] ZLimMode = auto ZScale = linear ZTick = [-1 0 1] ZTickLabel = ZTickLabelMode = auto ZTickMode = auto BeingDeleted = off ButtonDownFcn = Children = [100.006] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [1] Selected = off SelectionHighlight = on Tag = Type = axes UIContextMenu = [] UserData = [] Visible = on >> spy >> x=linspace(0,1,50); >> y=sin(2*pi*x*2)./(2*x+0.5); >> y10=10.^y; >> semilogy(x,y10) >> get(gca) ALim = [0 1] ALimMode = auto AmbientLightColor = [1 1 1] Box = on CameraPosition = [0.5 50.05 17.3205] CameraPositionMode = auto CameraTarget = [0.5 50.05 0] CameraTargetMode = auto CameraUpVector = [0 1 0] CameraUpVectorMode = auto CameraViewAngle = [6.60861] CameraViewAngleMode = auto CLim = [0 1] CLimMode = auto Color = [1 1 1] CurrentPoint = [ (2 by 3) double array] ColorOrder = [ (7 by 3) double array] DataAspectRatio = [1 99.9 2] DataAspectRatioMode = auto DrawMode = normal FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal GridLineStyle = : Layer = bottom LineStyleOrder = - LineWidth = [0.5] NextPlot = replace PlotBoxAspectRatio = [1 1 1] PlotBoxAspectRatioMode = auto Projection = orthographic Position = [0.13 0.11 0.775 0.815] TickLength = [0.01 0.025] TickDir = in TickDirMode = auto Title = [101.008] Units = normalized View = [0 90] XColor = [0 0 0] XDir = normal XGrid = off XLabel = [102.003] XAxisLocation = bottom XLim = [0 1] XLimMode = auto XScale = linear XTick = [ (1 by 11) double array] XTickLabel = [ (11 by 3) char array] XTickLabelMode = auto XTickMode = auto YColor = [0 0 0] YDir = normal YGrid = off YLabel = [103.004] YAxisLocation = left YLim = [0.1 100] YLimMode = auto YScale = log YTick = [0.1 1 10 100] YTickLabel = -1 0 1 2 YTickLabelMode = auto YTickMode = auto ZColor = [0 0 0] ZDir = normal ZGrid = off ZLabel = [104.003] ZLim = [-1 1] ZLimMode = auto ZScale = linear ZTick = [-1 0 1] ZTickLabel = ZTickLabelMode = auto ZTickMode = auto BeingDeleted = off ButtonDownFcn = Children = [3.0033] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [1] Selected = off SelectionHighlight = on Tag = Type = axes UIContextMenu = [] UserData = [] Visible = on >> set(gca) ALim ALimMode: [ {auto} | manual ] AmbientLightColor Box: [ on | {off} ] CameraPosition CameraPositionMode: [ {auto} | manual ] CameraTarget CameraTargetMode: [ {auto} | manual ] CameraUpVector CameraUpVectorMode: [ {auto} | manual ] CameraViewAngle CameraViewAngleMode: [ {auto} | manual ] CLim CLimMode: [ {auto} | manual ] Color ColorOrder DataAspectRatio DataAspectRatioMode: [ {auto} | manual ] DrawMode: [ {normal} | fast ] FontAngle: [ {normal} | italic | oblique ] FontName FontSize FontUnits: [ inches | centimeters | normalized | {points} | pixels ] FontWeight: [ light | {normal} | demi | bold ] GridLineStyle: [ - | -- | {:} | -. | none ] Layer: [ top | {bottom} ] LineStyleOrder LineWidth NextPlot: [ add | {replace} | replacechildren ] PlotBoxAspectRatio PlotBoxAspectRatioMode: [ {auto} | manual ] Projection: [ {orthographic} | perspective ] Position TickLength TickDir: [ {in} | out ] TickDirMode: [ {auto} | manual ] Title Units: [ inches | centimeters | {normalized} | points | pixels | characters ] View XColor XDir: [ {normal} | reverse ] XGrid: [ on | {off} ] XLabel XAxisLocation: [ top | {bottom} ] XLim XLimMode: [ {auto} | manual ] XScale: [ {linear} | log ] XTick XTickLabel XTickLabelMode: [ {auto} | manual ] XTickMode: [ {auto} | manual ] YColor YDir: [ {normal} | reverse ] YGrid: [ on | {off} ] YLabel YAxisLocation: [ {left} | right ] YLim YLimMode: [ {auto} | manual ] YScale: [ {linear} | log ] YTick YTickLabel YTickLabelMode: [ {auto} | manual ] YTickMode: [ {auto} | manual ] ZColor ZDir: [ {normal} | reverse ] ZGrid: [ on | {off} ] ZLabel ZLim ZLimMode: [ {auto} | manual ] ZScale: [ {linear} | log ] ZTick ZTickLabel ZTickLabelMode: [ {auto} | manual ] ZTickMode: [ {auto} | manual ] ButtonDownFcn: string -or- function handle -or- cell array Children Clipping: [ {on} | off ] CreateFcn: string -or- function handle -or- cell array DeleteFcn: string -or- function handle -or- cell array BusyAction: [ {queue} | cancel ] HandleVisibility: [ {on} | callback | off ] HitTest: [ {on} | off ] Interruptible: [ {on} | off ] Parent Selected: [ on | off ] SelectionHighlight: [ {on} | off ] Tag UIContextMenu UserData Visible: [ {on} | off ] >> theta=linspace(1,6*pi,100); >> rho=log10(theta); >> polar(theta,rho) >> get(gca) ALim = [0 1] ALimMode = auto AmbientLightColor = [1 1 1] Box = off CameraPosition = [0 0 24.9512] CameraPositionMode = auto CameraTarget = [0 0 0] CameraTargetMode = auto CameraUpVector = [0 1 0] CameraUpVectorMode = auto CameraViewAngle = [7.9097] CameraViewAngleMode = auto CLim = [0 1] CLimMode = auto Color = [1 1 1] CurrentPoint = [ (2 by 3) double array] ColorOrder = [ (7 by 3) double array] DataAspectRatio = [1 1 1] DataAspectRatioMode = manual DrawMode = normal FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal GridLineStyle = : Layer = bottom LineStyleOrder = - LineWidth = [0.5] NextPlot = replace PlotBoxAspectRatio = [1.5 1.725 1] PlotBoxAspectRatioMode = auto Projection = orthographic Position = [0.13 0.11 0.775 0.815] TickLength = [0.01 0.025] TickDir = in TickDirMode = auto Title = [126] Units = normalized View = [0 90] XColor = [0 0 0] XDir = normal XGrid = off XLabel = [127] XAxisLocation = bottom XLim = [-1.5 1.5] XLimMode = manual XScale = linear XTick = [ (1 by 7) double array] XTickLabel = -1.5 -1 -0.5 0 0.5 1 1.5 XTickLabelMode = auto XTickMode = auto YColor = [0 0 0] YDir = normal YGrid = off YLabel = [128] YAxisLocation = left YLim = [-1.725 1.725] YLimMode = manual YScale = linear YTick = [ (1 by 7) double array] YTickLabel = -1.5 -1 -0.5 0 0.5 1 1.5 YTickLabelMode = auto YTickMode = auto ZColor = [0 0 0] ZDir = normal ZGrid = off ZLabel = [129] ZLim = [-1 1] ZLimMode = auto ZScale = linear ZTick = [-1 0 1] ZTickLabel = ZTickLabelMode = auto ZTickMode = auto BeingDeleted = off ButtonDownFcn = Children = [125] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [1] Selected = off SelectionHighlight = on Tag = Type = axes UIContextMenu = [] UserData = [] Visible = off >> set(gca,'visible','on','color','r') >> h=get(gca,'children') h = 125.0005 >> figure >> plot(get(h,'xdata'),get(h,'ydata')) >> plotyy(x,y,x,y10); >> clf >> [ax, h1,h2]=plotyy(x,y,x,y10); >> whos ax Name Size Bytes Class ax 1x2 16 double array Grand total is 2 elements using 16 bytes >> get(ax(1)) ALim = [0 1] ALimMode = auto AmbientLightColor = [1 1 1] Box = on CameraPosition = [0.5 0.25 17.3205] CameraPositionMode = auto CameraTarget = [0.5 0.25 0] CameraTargetMode = auto CameraUpVector = [0 1 0] CameraUpVectorMode = auto CameraViewAngle = [6.60861] CameraViewAngleMode = auto CLim = [0 1] CLimMode = auto Color = [1 1 1] CurrentPoint = [ (2 by 3) double array] ColorOrder = [ (7 by 3) double array] DataAspectRatio = [1 2.5 2] DataAspectRatioMode = auto DrawMode = normal FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal GridLineStyle = : Layer = bottom LineStyleOrder = - LineWidth = [0.5] NextPlot = replace PlotBoxAspectRatio = [1 1 1] PlotBoxAspectRatioMode = auto Projection = orthographic Position = [0.13 0.11 0.775 0.815] TickLength = [0.01 0.025] TickDir = in TickDirMode = auto Title = [105.002] Units = normalized View = [0 90] XColor = [0 0 0] XDir = normal XGrid = off XLabel = [106.001] XAxisLocation = bottom XLim = [0 1] XLimMode = manual XScale = linear XTick = [ (1 by 11) double array] XTickLabel = [ (11 by 3) char array] XTickLabelMode = auto XTickMode = auto YColor = [0 0 1] YDir = normal YGrid = off YLabel = [107.001] YAxisLocation = left YLim = [-1 1.5] YLimMode = manual YScale = linear YTick = [-1 -0.5 0 0.5 1 1.5] YTickLabel = -1 -0.5 0 0.5 1 1.5 YTickLabelMode = auto YTickMode = manual ZColor = [0 0 0] ZDir = normal ZGrid = off ZLabel = [108.001] ZLim = [-1 1] ZLimMode = auto ZScale = linear ZTick = [-1 0 1] ZTickLabel = ZTickLabelMode = auto ZTickMode = auto BeingDeleted = off ButtonDownFcn = Children = [100.009] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [1] Selected = off SelectionHighlight = on Tag = Type = axes UIContextMenu = [] UserData = [] Visible = on >> get(ax(2)) ALim = [0 1] ALimMode = auto AmbientLightColor = [1 1 1] Box = off CameraPosition = [0.5 12.5 17.3205] CameraPositionMode = auto CameraTarget = [0.5 12.5 0] CameraTargetMode = auto CameraUpVector = [0 1 0] CameraUpVectorMode = auto CameraViewAngle = [6.60861] CameraViewAngleMode = auto CLim = [0 1] CLimMode = auto Color = none CurrentPoint = [ (2 by 3) double array] ColorOrder = [ (7 by 3) double array] DataAspectRatio = [1 25 2] DataAspectRatioMode = auto DrawMode = normal FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal GridLineStyle = : Layer = bottom LineStyleOrder = - LineWidth = [0.5] NextPlot = replace PlotBoxAspectRatio = [1 1 1] PlotBoxAspectRatioMode = auto Projection = orthographic Position = [0.13 0.11 0.775 0.815] TickLength = [0.01 0.025] TickDir = in TickDirMode = auto Title = [109.001] Units = normalized View = [0 90] XColor = [0 0 0] XDir = normal XGrid = off XLabel = [110.001] XAxisLocation = bottom XLim = [0 1] XLimMode = manual XScale = linear XTick = [ (1 by 11) double array] XTickLabel = [ (11 by 3) char array] XTickLabelMode = auto XTickMode = auto YColor = [0 0.5 0] YDir = normal YGrid = off YLabel = [111.001] YAxisLocation = right YLim = [0 25] YLimMode = manual YScale = linear YTick = [0 5 10 15 20 25] YTickLabel = 0 5 10 15 20 25 YTickLabelMode = auto YTickMode = manual ZColor = [0 0 0] ZDir = normal ZGrid = off ZLabel = [112.001] ZLim = [-1 1] ZLimMode = auto ZScale = linear ZTick = [-1 0 1] ZTickLabel = ZTickLabelMode = auto ZTickMode = auto BeingDeleted = off ButtonDownFcn = Children = [102.004] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [1] Selected = off SelectionHighlight = on Tag = Type = axes UIContextMenu = [] UserData = [] Visible = on >> set(ax(2),'off') ??? Error using ==> set Invalid axes property: 'off'. >> set(ax(2),'visible','off') >> set(ax(2),'visible','on') >> set(ax(2),'color','r') >> close >> whos x y Name Size Bytes Class x 1x50 400 double array y 1x50 400 double array Grand total is 100 elements using 800 bytes >> h=bar(x,y); >> get(h) AlphaDataMapping = scaled CData = [ (4 by 50) double array] CDataMapping = scaled FaceVertexAlphaData = [] FaceVertexCData = [ (251 by 1) double array] EdgeAlpha = [1] EdgeColor = [0 0 0] EraseMode = normal FaceAlpha = [1] FaceColor = flat Faces = [ (50 by 4) double array] LineStyle = - LineWidth = [0.5] Marker = none MarkerEdgeColor = auto MarkerFaceColor = none MarkerSize = [6] Vertices = [ (251 by 2) double array] XData = [ (4 by 50) double array] YData = [ (4 by 50) double array] ZData = [] FaceLighting = flat EdgeLighting = none BackFaceLighting = reverselit AmbientStrength = [0.3] DiffuseStrength = [0.6] SpecularStrength = [0.9] SpecularExponent = [10] SpecularColorReflectance = [1] VertexNormals = [ (251 by 3) double array] NormalMode = auto BeingDeleted = off ButtonDownFcn = Children = [] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [99.002] Selected = off SelectionHighlight = on Tag = Type = patch UIContextMenu = [] UserData = [] Visible = on