MATLAB Answers


Undefined function or method '...' for input arguments of type 'double'.

Asked by D
on 10 Apr 2011
Latest activity Commented on by Walter Roberson
on 10 Aug 2016

I'm getting the following error when I try to run some function m-files: ??? Undefined function or method '[name of function]' for input arguments of type 'double'.

I know this usually happens when the file isn't in the working directory, but that's not the case here.

When I was running these m-files in a different directory on my computer, it worked fine. I moved them to another directory on my laptop, and they're still fine, but I get this error on two of my desktops.

Thank you.

  1 Comment

I have encountered this several times, and I used an alternative to tackle it, rather than getting stuck with the rms function.

RMSvalue = sqrt(mean(freq.^2));


No products are associated with this question.

11 Answers

Answer by Eyasu getahun Chekole on 19 Apr 2015
Edited by Eyasu getahun Chekole on 19 Apr 2015

I am pretty sure that the reason why this problem happened is because of the license of the toolbox (package) in which this function belongs in. Write

which functionName 

and see what will be the result. If it returns path of the function and the comment

"Has no license available", 

then the problem is related to the license. That means, license of the package is not set correctly. Mostly it happens if the package (toolbox) of this function is added later, i.e., after installation of the original `matlab`. Please check and solve the license issue, then it will work fine.


This is the root cause for my case.

Thank you it help me in a great deal

Answer by Majid
on 12 Aug 2013

In my case, there was a function that is used in my code but it was not in the directory, so by changing the location of the sub function and copying in the active directory , the problem is solved now.


Mohammad Heydari comments,

sounds rational

how to change the loaction???

Use your operating system tools to copy the directory and then use pathtool to add the new location to your MATLAB path.

Answer by Walter Roberson
on 11 Apr 2011

Are you function names in mixed case, and your laptop runs Windows but your desktop runs Linux ?


on 11 Apr 2011

Yes, the function names are mixed case.

The laptop and one of the desktops run Windows 7.
The other one is a Mac.

I get the same errors on both desktops, though.

on 13 Mar 2014

Remember that the first function of the .m-file must have the same name as the file itself.

really work

Answer by Paulo Silva
on 10 Apr 2011

change the working directory to the folder where you have your code or add the path.

Go to the File and choose the Set Path


on 10 Apr 2011

That's not the problem. The file is in the working directory.

I've tried running it from the editor, but I'm getting the same error.

You have to add the path

Answer by n
on 28 May 2012


Please consider that you should be EXACTLY in the same directory; and not even in sub-directories within the right path.

I hope this solves the case. It worked for me.

  1 Comment

This worked for me, thank you.

Answer by Keith Kripp
on 10 Jun 2013

I've encountered this error when attempting to call MEX functions that were built/compiled on machines running a different version of Windows.

e.g. I build a MEX file from source code on a 32 bit machine, transfer it somewhere down the road to a 64 bit machine, and then attempt to call the function.

Seems like this error often has little to do with the arg type being 'double.'

  1 Comment

Matt J
on 10 Jun 2013

Seems like this error often has little to do with the arg type being 'double.'

Well, sometimes it genuinely is an issue of the arg type, as shown here

>> sin('a')
Undefined function 'sin' for input arguments of type 'char'.

Clear 'sin' does exist, but just doesn't know what to do with char input.

As for the MEX-file issue, that has nothing to do with the 64bit-ness of Windows, only the 64bitness of the MATLAB version. 64-bit MATLAB will be looking for files with extension 'mexw64' whereas a 32-bit compiled mex file will have extension 'mexw32'. So, that really is a case of MATLAB not being able to find a matching file.

Answer by Devi Jorks
on 18 Jul 2013

in case of the sin(a) just dont put the '', then it works fine, at least on winxp 32bit


Answer by Resorcap
on 8 Nov 2014

Before run function, add current absolute path:


And this worked for me.


Answer by chao dong
on 21 Mar 2016

For me,the reason why this error occured was because I used a method that actually did not belongs to the object I used to invoke.This means that I should first transform my object to another type of data,for me,I actually have to change the object belongs to vehicle class to mini class to specify its data type. OOP's philosophy is indeed very important for you to understand why it occured and solve the error.


Answer by eranna annigeri on 24 Jul 2016
Edited by Walter Roberson
on 24 Jul 2016

hi all ,

i am getting this error in the glcm code can anyone help me with this error

stats = GLCM_features1(GLCM2,0)

Undefined function 'GLCM_features1' for input arguments of type 'double'.

Answer by Nensi Tallamma
on 10 Aug 2016

Hi i'm getting this error " ??? Undefined function or method 'wavelet' for input arguments of type 'double'." , when i'm try to run :

[wave,period,scale,coi] = wavelet (madden_julian,dt,pad,dj,s0,j1,mother);

Can anyone help me with this error?

  1 Comment

Mathworks does not define a function named "wavelet" in any toolbox.

I checked and it does not appear that any of the File Exchange contributions happen to define a function with that name either.

You appear to be using the code from G08isu.pdf. It appears to use software from; it looks like you can find the source code at

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!