Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
conversion to a complex pair

Subject: conversion to a complex pair

From: Anush

Date: 23 Mar, 2012 19:24:20

Message: 1 of 3

How to convert the x, y coordinates in the contour to a one dimensional vector by treating them as a complex pair. That is: U(n) = X(n) + i * Y(n)

Subject: conversion to a complex pair

From: Jomar Bueyes

Date: 23 Mar, 2012 19:43:19

Message: 2 of 3

On Friday, March 23, 2012 3:24:20 PM UTC-4, Anush wrote:
> How to convert the x, y coordinates in the contour to a one dimensional vector by treating them as a complex pair. That is: U(n) = X(n) + i * Y(n)

It's as simple as the equation you wrote. However, you can save the loop for each n by

>> U = X +1i * Y;

Notice the notation for the imaginary number sqrt(-1). It's a number one followed by the letter i.

HTH

Jomar

Subject: conversion to a complex pair

From: Nasser M. Abbasi

Date: 23 Mar, 2012 19:47:27

Message: 3 of 3

On 3/23/2012 2:24 PM, Anush wrote:
> How to convert the x, y coordinates in the contour to a one dimensional
>vector by treating them as a complex pair. That is: U(n) = X(n) + i * Y(n)

may be

-----------------
C = [1 2;2 3;4 5]; %the contour
U = C(:,1) + sqrt(-1) * C(:,2)


    1.0000 + 2.0000i
    2.0000 + 3.0000i
    4.0000 + 5.0000i

Tags for this Thread

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.

Contact us