# Help needed in Syntax writing in MATLAB

• Mar 2nd 2010, 05:48 AM
Geomorphologist
Help needed in Syntax writing in MATLAB
Howdi all,
I'm trying to write the syntax for this formula but keep getting errors. Any help ? I belive it's happening due the complex number (i).
http://img684.imageshack.us/img684/9945/30438176.png
• Mar 2nd 2010, 08:33 AM
CaptainBlack
Quote:

Originally Posted by Geomorphologist
Howdi all,
I'm trying to write the syntax for this formula but keep getting errors. Any help ? I belive it's happening due the complex number (i).
http://img684.imageshack.us/img684/9945/30438176.png

CB
• Mar 2nd 2010, 09:12 PM
Geomorphologist
Well, If i'm using this syntax (Without the complex number) - It works :

>> (tanh(exp(log(3*pi)+log10(pi)))^3)/(7^8)

ans =

1.7347e-007

But as soon as I add the 'i' :

>> (tanh(exp(log(3*pi)+log10(pi)i))^3)/(7^8)
|
Error: Unexpected MATLAB expression.

Something went wrong.
• Mar 2nd 2010, 09:42 PM
CaptainBlack
Quote:

Originally Posted by Geomorphologist
Well, If i'm using this syntax (Without the complex number) - It works :

>> (tanh(exp(log(3*pi)+log10(pi)))^3)/(7^8)

ans =

1.7347e-007

But as soon as I add the 'i' :

>> (tanh(exp(log(3*pi)+log10(pi)i))^3)/(7^8)
|
Error: Unexpected MATLAB expression.

Something went wrong.

Code:

``` --> (tanh(exp(log(3*pi)+log10(pi)*i))^3)/(7^8)                                                                                                      ans =                                                                                                                                                  1.7347e-007 +2.7977e-014i```
CB
• Mar 2nd 2010, 09:49 PM
Geomorphologist
Quote:

Originally Posted by CaptainBlack
Code:

``` --> (tanh(exp(log(3*pi)+log10(pi)*i))^3)/(7^8)                                                                                                      ans =                                                                                                                                                  1.7347e-007 +2.7977e-014i```
CB

Danke!!! (Clapping)
So obvious ... (Nod)