Thread Subject: plotting complex numbers

Subject: plotting complex numbers

From: Jason

Date: 5 Dec, 2008 15:00:20

Message: 1 of 2

Hello,

I have MATLAB which I have used very successfully for other stuff. I have never used it for complex numbers. A colleague wishes to plot a function - he is having problems with another program and asked me about Matlab ;-)

The funtion is

1 + 1/(x(iy-x))

for -2 < x < 2
    -2 < y < 2

I am guessing I need to plot an array of complex numbers or something

Can some kind soul please tell me how to do this? I would rather not have to do a refresher course on complex numbers ;-)

Subject: plotting complex numbers

From: Adam

Date: 5 Dec, 2008 16:00:21

Message: 2 of 2

"Jason" <j_henderson44@REMOVEhotmail.com> wrote in message <ghbfm4$bfh$1@fred.mathworks.com>...
> Hello,
>
> I have MATLAB which I have used very successfully for other stuff. I have never used it for complex numbers. A colleague wishes to plot a function - he is having problems with another program and asked me about Matlab ;-)
>
> The funtion is
>
> 1 + 1/(x(iy-x))
>
> for -2 < x < 2
> -2 < y < 2
>
> I am guessing I need to plot an array of complex numbers or something
>
> Can some kind soul please tell me how to do this? I would rather not have to do a refresher course on complex numbers ;-)

you can just plot imaginary numbers

x = -2: 0.01: 2;
[X Y] = meshgrid(x);
Z = 1+1./(X .* (1i*Y-X));

plot(Z, '.-')

do you want to plot it vs x and y? In signal processing you would do magnitude and phase plots
mesh(X, Y, log10(abs(Z)))

mesh(X, Y, unwrap(angle(Z)))

If this doesn't help you may need to explain more.
~Adam

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
complex Jason 5 Dec, 2008 10:05:06
numbers Jason 5 Dec, 2008 10:05:06
plotting Jason 5 Dec, 2008 10:05:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com