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
about 9 hours ago

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.

14 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

Answer by Lang Hu
on 11 Oct 2016 at 3:27
Edited by Lang Hu
on 11 Oct 2016 at 3:32

I met the problem ??? Undefined function or method 'cdfcalc' for input arguments of type 'double'. Besides, when I use cmd "which cdfcalc", returned that no such a function found. I wonder if I missed to install something?

Plus: When I went to the download page, I have these to download: Installer.exe

I downloaded them all and installed. But when installing, it alerted me that no Simulink. How should I handle this?

  1 Comment

Walter Roberson
on 11 Oct 2016 at 5:45

cdfcalc is from the Statistics and Machine Learning toolbox. It appears that you have not installed that.

The Signal Processing Blockset that are trying to install requires Simulink and is useless without Simulink. It does not affect use of the Signal Processing Toolbox by itself, so you should only install Signal Processing Blockset if you install Simulink.

If you have a Student Suite license, then you might simply have not told the installer to install those packages.

Answer by 0460051 NCTU
on 11 Oct 2016 at 9:27

I have the same problem.Here is my error.

An UndefinedFunction error was thrown on the workers for 'configurePin'. This might be because the file containing 'configurePin' is not accessible on the workers. Use addAttachedFiles(pool, files) to specify the required files to be attached. See the documentation for 'parallel.Pool/addAttachedFiles' for more details.

Caused by: Error using parallel_function>make_general_channel/channel_general (line 929) Undefined function 'configurePin' for input arguments of type 'double'.

I'm trying to communicate matlab and arduino.However, it's always running wrong.What's happened?


Walter Roberson
on 22 Oct 2016 at 22:00

I do not seem to be able to locate any fmsin . If you happened to mean fmsim then it appears that is a very old routine available from Fuzzy Identification Toolbox

kaushik das
on 23 Oct 2016 at 8:30

THANK YOU..... I tried to remove error with all the ideas i got,but still it is showing some error......the .m file is attached so help me to fix this error....

Walter Roberson
on 23 Oct 2016 at 9:09

It appears you need the Time Frequency Toolbox,

Answer by indah octaviyani about 22 hours ago

i got this error,, could you help me?

Undefined function 'generateExplicit' for input arguments of type 'MPCController'.


It appears you would probably want generateExplicitRange or generateExplicitMPC; see

thank you, but then i got this error too, how can i fix it?

Error using subsindex Function 'subsindex' is not defined for values of class 'ss'.

We would probably need to see your code. Please create a new Question with your code shown and a complete traceback of the error message.

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!