Hi
answer 1:
x=linspace(-4,4,61)
y=linspace(-3,3,81)
[X,Y]=meshgrid(x,y)
Z=X.^2-2*X.*Y+3*Y+2
surf(Z)
answer 2
or
answer 3
the handle to the surface properties is
h(1)
=
Surface with properties:
EdgeColor: 'flat'
LineStyle: '-'
FaceColor: [1 1 1]
FaceLighting: 'none'
FaceAlpha: 1
XData: [81x61 double]
YData: [81x61 double]
ZData: [81x61 double]
CData: [81x61 double]
Show all properties
AlignVertexCenters: 'off'
AlphaData: 1
AlphaDataMapping: 'scaled'
AmbientStrength: [1x1 double]
Annotation: [1x1 matlab.graphics.eventdata.Annotation]
BackFaceLighting: 'reverselit'
BeingDeleted: 'off'
BusyAction: 'queue'
ButtonDownFcn: ''
CData: [81x61 double]
CDataMapping: 'scaled'
CDataMode: 'auto'
CDataSource: ''
Children: []
Clipping: 'on'
CreateFcn: ''
DeleteFcn: ''
DiffuseStrength: [1x1 double]
DisplayName: ''
EdgeAlpha: 1
EdgeColor: 'flat'
EdgeLighting: 'flat'
FaceAlpha: 1
FaceColor: [1 1 1]
FaceLighting: 'none'
FaceNormals: [80x60x3 double]
FaceNormalsMode: 'auto'
HandleVisibility: 'on'
HitTest: 'on'
Interruptible: 'on'
LineStyle: '-'
LineWidth: [1x1 double]
Marker: 'none'
MarkerEdgeColor: 'auto'
MarkerFaceColor: 'none'
MarkerSize: 6
MeshStyle: 'both'
Parent: [1x1 Axes]
PickableParts: 'visible'
Selected: 'off'
SelectionHighlight: 'on'
SpecularColorReflectance: 1
SpecularExponent: 10
SpecularStrength: [1x1 double]
Tag: ''
Type: 'surface'
UIContextMenu: []
UserData: []
VertexNormals: [81x61x3 double]
VertexNormalsMode: 'auto'
Visible: 'on'
XData: [81x61 double]
XDataMode: 'manual'
XDataSource: ''
YData: [81x61 double]
YDataMode: 'manual'
YDataSource: ''
ZData: [81x61 double]
ZDataSource: ''
by 'shading of the surface' I understand
answer 4
the handle to the contour is
h(2)
=
Contour with properties:
LineColor: 'flat'
LineStyle: '-'
LineWidth: 1.500000000000000
Fill: 'off'
LevelList: [-10 0 10 20 30 40 50]
XData: [81x61 double]
YData: [81x61 double]
ZData: [81x61 double]
Show all properties
Annotation: [1x1 matlab.graphics.eventdata.Annotation]
BeingDeleted: 'off'
BusyAction: 'queue'
ButtonDownFcn: ''
Children: []
Clipping: 'on'
ContourMatrix: [2x469 double]
CreateFcn: ''
DeleteFcn: ''
DisplayName: ''
Fill: 'off'
HandleVisibility: 'on'
HitTest: 'on'
Interruptible: 'on'
LabelSpacing: 144
LevelList: [-10 0 10 20 30 40 50]
LevelListMode: 'auto'
LevelStep: 10
LevelStepMode: 'auto'
LineColor: 'flat'
LineStyle: '-'
LineWidth: 1.500000000000000
Parent: [1x1 Axes]
PickableParts: 'visible'
Selected: 'off'
SelectionHighlight: 'on'
ShowText: 'off'
Tag: ''
TextList: [-10 0 10 20 30 40 50]
TextListMode: 'auto'
TextStep: 10
TextStepMode: 'auto'
Type: 'contour'
UIContextMenu: []
UserData: []
Visible: 'on'
XData: [81x61 double]
XDataMode: 'manual'
XDataSource: ''
YData: [81x61 double]
YDataMode: 'manual'
YDataSource: ''
ZData: [81x61 double]
ZDataSource: ''
the contour line width can be changed with
Regarding the color request, I am not sure whether the 'overlaid mesh' comment means the color of the actual figure, that you can change color altering
h(1).FaceAlpha
h(1).FaceColor:
h(1).FaceLighting
or the color of the contours, that you can change with
If you find this answer of any help solving your question, please click on the thumbs-up vote link,
thanks in advance
John