Got Questions? Get Answers.
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:
bug in symbolic toolbox? ln instead of log??

Subject: bug in symbolic toolbox? ln instead of log??

From: Floris Zoutman

Date: 14 Apr, 2010 13:53:05

Message: 1 of 3

I am trying to use the symbolic toolbox but there seems to be an extremely stupid bug in my version of matlab. I have tried the following line of code:
x=sym('x')
y=log(x)
output: y=ln(x)
f=matlabFunction(y)
output f=@(x)ln(x)
f(3)
output: Error unknown function ln.

For some reason matlab's symbolic toolbox seems to replace the function log, which is a built-in function to calculate the natural logarithm of a number, with the function ln, a function that does not exist. Can anybody tell me why this happens and how to fix it? I am using Matlab R2009A 32-bit on Windows XP. Many thanks for your help!

With kind regards,

Floris

Subject: bug in symbolic toolbox? ln instead of log??

From: almog shalom

Date: 25 Apr, 2010 13:17:08

Message: 2 of 3

Your bug is very strange, indeed.
I use R2009a on Linux (Suse) with x86_64 architecture and don't have this bug.

Subject: bug in symbolic toolbox? ln instead of log??

From: Ivan

Date: 10 Mar, 2011 08:06:04

Message: 3 of 3

Hi man, I got the same problem!!!
I wanna solve a set of nonlinear equations using newton's method. I got natural log terms in my equations. Error: Undefined function or method 'ln' for input arguments of type 'double' or Undefined function or method 'ln' for input arguments of type 'sym'.
 How did you fix it by the end? Thanks!

ivan
"Floris Zoutman" wrote in message <hq4hc1$rne$1@fred.mathworks.com>...
> I am trying to use the symbolic toolbox but there seems to be an extremely stupid bug in my version of matlab. I have tried the following line of code:
> x=sym('x')
> y=log(x)
> output: y=ln(x)
> f=matlabFunction(y)
> output f=@(x)ln(x)
> f(3)
> output: Error unknown function ln.
>
> For some reason matlab's symbolic toolbox seems to replace the function log, which is a built-in function to calculate the natural logarithm of a number, with the function ln, a function that does not exist. Can anybody tell me why this happens and how to fix it? I am using Matlab R2009A 32-bit on Windows XP. Many thanks for your help!
>
> With kind regards,
>
> Floris

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