function fig = congrad() % This is the machine-generated representation of a Handle Graphics object % and its children. Note that handle values may change when these objects % are re-created. This may cause problems with any callbacks written to % depend on the value of the handle at the time the object was saved. % % To reopen this object, just type the name of the M-file at the MATLAB % prompt. The M-file and its associated MAT-file must be on your path. load congrad h0 = figure('Color',[0.8 0.8 0.8], ... 'Colormap',mat0, ... 'Name','Contour Plots and Gradients', ... 'PaperOrientation','landscape', ... 'PaperPosition',[2.270833333333333 2.0625 6.458333333333333 4.375], ... 'PaperPositionMode','auto', ... 'PointerShapeCData',mat1, ... 'Position',[64 85 620 420], ... 'Renderer','zbuffer', ... 'RendererMode','manual', ... 'Tag','Fig1', ... 'WindowButtonDownFcn','rotate3d(''down'')', ... 'WindowButtonUpFcn','rotate3d(''up'')'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941 0.752941 0.752941], ... 'ListboxTop',0, ... 'Position',[340.5 285 87.75 16.5], ... 'String','Your Function', ... 'Style','text', ... 'Tag','functiontext'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[367.5 255 75 18.75], ... 'String','3*x+y', ... 'Style','edit', ... 'Tag','functioncongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941 0.752941 0.752941], ... 'ListboxTop',0, ... 'Position',[337.5 231.75 43.5 15], ... 'String','xmin', ... 'Style','text', ... 'Tag','StaticText2'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[394.5 229.5 27 15.75], ... 'String','-8', ... 'Style','edit', ... 'Tag','xmincongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[394.5 210 27 15.75], ... 'String','8', ... 'Style','edit', ... 'Tag','xmaxcongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[337.5 210 43.5 15], ... 'String','xmax', ... 'Style','text', ... 'Tag','ymax'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941 0.752941 0.752941], ... 'ListboxTop',0, ... 'Position',[337.5 165 43.5 15], ... 'String','ymax', ... 'Style','text', ... 'Tag','ymax'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[394.5 165 27 15.75], ... 'String','8', ... 'Style','edit', ... 'Tag','ymaxcongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[394.5 186.75 27 15.75], ... 'String','-8', ... 'Style','edit', ... 'Tag','ymincongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[337.5 187.5 43.5 15], ... 'String','ymin', ... 'Style','text', ... 'Tag','StaticText2'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback',mat2, ... 'ListboxTop',0, ... 'Position',[318.75 56.25 78.75 24], ... 'String','Contour Plot', ... 'Tag','Pushbutton1'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback',mat3, ... 'ListboxTop',0, ... 'Position',[318.75 18.75 78.75 24], ... 'String','Plot the Gradient', ... 'Tag','Pushbutton1'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','delete(findobj(''Tag'',''contour''));delete(findobj(''Tag'',''contourlabel''))', ... 'ListboxTop',0, ... 'Position',[412.5 56.25 45 23.25], ... 'String','Clear', ... 'Tag','Pushbutton2'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','delete(findobj(''Tag'',''grad''));', ... 'ListboxTop',0, ... 'Position',[412.5 18.75 45 23.25], ... 'String','Clear', ... 'Tag','Pushbutton2'); h1 = axes('Parent',h0, ... 'Box','on', ... 'CameraUpVector',[0 1 0], ... 'CameraUpVectorMode','manual', ... 'Color',[1 1 1], ... 'ColorOrder',mat4, ... 'Position',mat5, ... 'Tag','Axes1', ... 'XColor',[0 0 0], ... 'XGrid','on', ... 'XLim',[-8 8], ... 'XLimMode','manual', ... 'YColor',[0 0 0], ... 'YGrid','on', ... 'YLim',[-8 8], ... 'YLimMode','manual', ... 'ZColor',[0 0 0]); h2 = text('Parent',h1, ... 'Color',[0 0 0], ... 'HandleVisibility','off', ... 'HorizontalAlignment','center', ... 'Position',[-0.04371584699453646 -9.142857142857142 9.160254037844386], ... 'Tag','Axes1Text4', ... 'VerticalAlignment','cap'); set(get(h2,'Parent'),'XLabel',h2); h2 = text('Parent',h1, ... 'Color',[0 0 0], ... 'HandleVisibility','off', ... 'HorizontalAlignment','center', ... 'Position',[-8.961748633879781 -0.04761904761904745 9.160254037844386], ... 'Rotation',90, ... 'Tag','Axes1Text3', ... 'VerticalAlignment','baseline'); set(get(h2,'Parent'),'YLabel',h2); h2 = text('Parent',h1, ... 'Color',[0 0 0], ... 'HandleVisibility','off', ... 'HorizontalAlignment','right', ... 'Position',[-9.704918032786885 9.666666666666664 9.160254037844386], ... 'Tag','Axes1Text2', ... 'Visible','off'); set(get(h2,'Parent'),'ZLabel',h2); h2 = text('Parent',h1, ... 'Color',[0 0 0], ... 'HandleVisibility','off', ... 'HorizontalAlignment','center', ... 'Position',[-0.04371584699453646 8.333333333333332 9.160254037844386], ... 'Tag','Axes1Text1', ... 'VerticalAlignment','bottom'); set(get(h2,'Parent'),'Title',h2); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[337.5 255 30 15], ... 'String','z=', ... 'Style','text', ... 'Tag','StaticText1'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[337.5 131.25 18.75 15], ... 'Style','radiobutton', ... 'Tag','congradbutton', ... 'Value',1); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[356.25 131.25 93.75 18.75], ... 'String','Click here for automatic contours', ... 'Style','text', ... 'Tag','StaticText3'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[341.25 112.5 30 15], ... 'String','zmin', ... 'Style','text', ... 'Tag','StaticText4'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[373.5 112.5 26.25 15], ... 'Style','edit', ... 'Tag','zmincongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[435 112.5 26.25 15], ... 'Style','edit', ... 'Tag','zmaxcongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[401.25 112.5 30 15], ... 'String','zmax', ... 'Style','text', ... 'Tag','StaticText4'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[403.5 93.75 26.25 15], ... 'Style','edit', ... 'Tag','zsclcongrad'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.752941176470588 0.752941176470588 0.752941176470588], ... 'ListboxTop',0, ... 'Position',[371.25 93.75 30 15], ... 'String','zscl', ... 'Style','text', ... 'Tag','StaticText4'); if nargout > 0, fig = h0; end