File Exchange

image thumbnail


version (2.96 KB) by Peter Caday
Plot complex-valued functions in color


Updated 29 Dec 2014

View License

Compleximagesc is a replacement for the imagesc command that works with complex-valued matrices.
The matrix entries determine the color of the image. Brightness (value) is determined by the number's magnitude, while hue is determined by the argument.
Magnitude is mapped linearly to brightness; the range is determined automatically from the range of magnitudes in the image, or can be specified manually by including an [rmin rmax] parameter at the end of the argument list. rmin is mapped to black and rmax is mapped to maximum brightness.

Arguments (in the range 0 <= arg <= 2*pi) are mapped linearly to hue (in the range 0 <= h <= 1). For instance, an argument of 2*pi/3 corresponds to green, and 5*pi/6 corresponds to magenta.

compleximagesc supports all the syntax supported by imagesc:

h = compleximagesc(C)
h = compleximagesc(x,y,C)
h = compleximagesc(..., [rmin rmax])
h = compleximagesc(..., 'Property1', Value1, ... 'PropertyN', ValueN)

If no image C is provided, compleximagesc is the same as image.

Cite As

Peter Caday (2020). compleximagesc (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!