Re: Can you help me rewrite my matlab code to mathematica code?

• To: mathgroup at smc.vnet.net
• Subject: [mg90709] Re: Can you help me rewrite my matlab code to mathematica code?
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Sun, 20 Jul 2008 06:34:06 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <g5s9t5\$54e\$1@smc.vnet.net>

```djliu2006 at 163.com wrote:

> Rectntly, i wrote a code using matlab. in the code written by me, i
> use a function erf(x), while the x used by me is complex arguments, so
> the matlab cannot give the results. i realized that the mathematica can
> realize this. I'm a green hand in Mathematica, so I cannot rewrite my
> matlab code to Mathematica. the matlab code written by me is attached
> is there anyone can help me rewrite the code using Mathematica.

<snip>

Hum, the code you posted on this forum is not in -- not even close to --
Mathematica syntax, so one may wonder if you even try to write anything
by yourself...

To help you started, the erf function is *Erf[z]* in Mathematica and it
works over the complex field.

In[1]:= Erf[1.5 - I]

Out[1]= 1.0784+ 0.0279637 I

Also, in addition to the introductory material available with any
standard installation of Mathematica, you should read the following
short articles:

"How are the different brackets, such as {}, [], and () used in
Mathematica?"
http://support.wolfram.com/mathematica/kernel/features/brackets.html

"Why doesn't sin[x] work in Mathematica?"
http://support.wolfram.com/mathematica/kernel/features/casesensitive.html

"What is the difference between =, ==, === in Mathematica?"
http://support.wolfram.com/mathematica/kernel/features/differentequals.html

"Why aren't my assignments and function definitions working?"
http://support.wolfram.com/mathematica/kernel/features/assignments.html

Regards,
-- Jean-Marc

```

• Prev by Date: Re: On default numerical precision
• Next by Date: Re: export eps
• Previous by thread: Re: Can you help me rewrite my matlab code to mathematica code?
• Next by thread: Re: Re: Re: Collapsing cell groups [was: Mathematica