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

5 views (last 30 days)
Faraz Ali
Faraz Ali on 15 Sep 2021
Commented: Faraz Ali on 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

Answers (1)

Steven Lord
Steven Lord on 15 Sep 2021
Use the contour or contour3 functions.
  3 Comments
Steven Lord
Steven Lord on 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 on 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?

Sign in to comment.

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!