Be the first to rate this file! 16 Downloads (last 30 days) File Size: 1.73 KB File ID: #27846

Phase and amplitude hue plot

by

 

07 Jun 2010 (Updated )

Plots a complex 2D array. The phase is shown as hue and the amplitude as brightness.

| Watch this File

File Information
Description

This routine was meant to be used as a tool to represent the a complex electric field in a plane (with phase and amplitude)
Usage:
PHPLOT(FIELD)
Plots the phase of a 2D complex array (FIELD) in a continuous color scale (hue) and represents the normalized amplitude as brightness (r+g+b)*amplitude.
PHPLOT(FIELD,AMP,FLAG)
If AMP = 0 the amplitude is not plotted
If FLAG = 1 the function creates a figure with a dial scale (from 0 to 2*pi) and radial brightness (from 0 to one)
A=PHPLOT(...) creates a 3D uint8 array that can be saved as an image with the syntax IMWRITE(A,'filename','fmt').

Example:
[x,y]=meshgrid(-3*pi:0.1:3*pi);
F=sin(x.*y)-x*i;
subplot(1,3,1)
imagesc(abs(F))
subplot(1,3,2)
imagesc(angle(F))
subplot(1,3,3)
phplot(F,1,0);
axis image

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
07 Jun 2010

Added an example in the description.
Fixed a bug occurring when plotting the scale.

Contact us