I am trying to create an image in matlab which contains specified level sets for a complex polynomial. Suppose, for example, I wanted to create an image containing the sets $\{z\in\mathbb{C}:|p(z)|=2\}$, $\{z\in\mathbb{C}:|p(z)|=5\}$, $\{z\in\mathbb{C}:|p(z)|=9.5\}$. Could someone help me out with the code for this? Thanks
2026-04-08 00:42:26.1775608946
On
Creating image in matlab with specified level sets of a complex polynomial.
1.4k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
1
On
Not exactly Matlab, but gnuplot is a free professional graphing utility that can graph level curves, and produce figures appropriate for latex.
Here is a link with some code for a level curve:
http://benice-equation.blogspot.com/2011/07/gnuplot-example-plotting-implicit.html
Taking the Benice equation example from @Joel's answer, in Matlab this can be done simply via the builtin
contouror the lower-levelcontourcfunctions:As the help/documentation points out, the key is the fourth argument to
contourandcontourcfunctions,v. If you want plot just one level set,w, then you must setv = [w w].More on creating contour plots with Matlab.