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:
complex error function and syms

Subject: complex error function and syms

From: Rok mr

Date: 11 Oct, 2012 13:02:08

Message: 1 of 2

Hi,
I would like to use erf function for complex numbers. Where complex number contain symbol
example:

sig=any real number
syms w
z=sig+i*w
e=erf(z)
(return: Complex number with symbol w)

Any hints how to solve this problem?
Thank you in advance!

Subject: complex error function and syms

From: Christopher Creutzig

Date: 26 Nov, 2012 15:30:37

Message: 2 of 2

On 11.10.12 15:02, Rok mr wrote:
> Hi,
> I would like to use erf function for complex numbers. Where complex number contain symbol
> example:
>
> sig=any real number
> syms w
> z=sig+i*w
> e=erf(z)
> (return: Complex number with symbol w)
>
> Any hints how to solve this problem?

I'm not sure what the “problem” is.

>> sig = 2;
>> syms w
>> z=sig+i*w

z =

w*i + 2

>> e=erf(z)

e =

erf(w*i + 2)

>> subs(e, w, 2)

ans =

erf(2 + 2*i)

>> double(subs(e, w, 2))

ans =

   1.1513 + 0.1273i


Behaves exactly as I would have expected. (Tested in R2012a.)



Christopher

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