How to add black isolines for f(x,y) = -1, 0, 1

2 Ansichten (letzte 30 Tage)
Faraz Ali
Faraz Ali am 15 Sep. 2021
Kommentiert: Faraz Ali am 16 Sep. 2021
Hi ,
I have f(x,y) and I want to add black isolines for f(x,y) = -1, 0, 1. How can I do it?
Thanks

Antworten (1)

Steven Lord
Steven Lord am 15 Sep. 2021
Use the contour or contour3 functions.
  3 Kommentare
Steven Lord
Steven Lord am 15 Sep. 2021
[x, y, z] = peaks;
surf(x, y, z)
shading interp
hold on
contour3(x, y, z, [-1, 0, 1], 'k')
Faraz Ali
Faraz Ali am 16 Sep. 2021
Is the default color of isolines black ?
I have f(x,y) = sinx+cosy ( for example). I have to assign f(x,y) to "z" variable for contour? Does it work in the same way for adding black isolines?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by