Undefined function or method '...' for input arguments of type 'double'.
이전 댓글 표시
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.
댓글 수: 8
Anveshkumar Kolluri
2016년 6월 28일
편집: Walter Roberson
2026년 1월 18일
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));
Saiful Haqiqi Hassan
2018년 12월 11일
try read this. it explained in details about this error
Walter Roberson
2019년 1월 30일
sameeksha shrivastava comments:
i m also get the error Undefined function 'imsegkmeans' for input arguments of type 'single'.
Walter Roberson
2019년 1월 30일
https://www.mathworks.com/help/images/ref/imsegkmeans.html was introduced in R2018b and would not be available in any previous release.
Selami Dogan Akansu
2020년 12월 13일
installing related toolbox solved my problem.
Jithin Nambiar J
2021년 4월 10일
It sometimes gives you this error if you don't have the right toolboxes installed for the certain function.
If a particular function is causing an error. Try typing
help functionName
If this results in like a certain toolbox is required for this function to work. Just click on the hyperlink or underlined link which is given in the terminal.
It will direct you to the appropriate package. Make sure you save any programs. Since installing the packages requires MATLAB to restart.
Cheers !!
Arun kumar
2021년 8월 30일
Thank you it is realy helpfull
Gloria
2025년 2월 3일
Same
채택된 답변
추가 답변 (30개)
Eyasu getahun Chekole
2015년 4월 19일
편집: Eyasu getahun Chekole
2015년 4월 19일
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.
댓글 수: 5
Jennifer Wu
2015년 11월 25일
This is the root cause for my case.
Zohaib Ahmad
2016년 7월 7일
Thank you it help me in a great deal
ibadullah safdar
2018년 5월 20일
I am actually facing this problem too as my inpoly function is running accurately before installation of a new matlab but now I am running the same code with old file of poly function but it is showing the error of undefined inpooly function. Kindly tell me how to resolve the license issue as I have also checked my code by intalling new function of inpoly but the problem persist. Kindly help in this matter.
Walter Roberson
2018년 5월 20일
inpoly is not a Mathworks supplied function. https://www.mathworks.com/matlabcentral/fileexchange/10391-fast-points-in-polygon-test
ibadullah safdar
2018년 5월 29일
problem resolved Roberson. Thank you so much.
Majid
2013년 8월 12일
14 개 추천
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.
댓글 수: 6
Walter Roberson
2016년 6월 26일
Mohammad Heydari comments,
sounds rational
Devashish Sharma
2016년 7월 25일
how to change the loaction???
Walter Roberson
2016년 7월 25일
Use your operating system tools to copy the directory and then use pathtool to add the new location to your MATLAB path.
David J. Mack
2017년 3월 3일
This helped in my case. Thx Walter!
Sehairi K.
2021년 9월 4일
This helped me too
Thanks a lot
Christian Gomez
2022년 1월 26일
thankyou you saved me
Paulo Silva
2011년 4월 10일
2 개 추천
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
n
2012년 5월 28일
2 개 추천
Hi,
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.
댓글 수: 2
g.shaanti
2016년 7월 22일
This worked for me, thank you.
Amirah Algethami
2023년 6월 12일
How to do this???
Walter Roberson
2011년 4월 11일
1 개 추천
Are you function names in mixed case, and your laptop runs Windows but your desktop runs Linux ?
댓글 수: 4
D
2011년 4월 11일
nasyim rosli
2016년 5월 28일
really work
Rose WABUTI
2018년 10월 2일
thank you, saved my life...lol
Keith Kripp
2013년 6월 10일
0 개 추천
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
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.
Resorcap
2014년 11월 8일
Before run function, add current absolute path:
add(pwd);
And this worked for me.
chao dong
2016년 3월 21일
0 개 추천
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.
eranna annigeri
2016년 7월 24일
편집: Walter Roberson
2016년 7월 24일
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'.
댓글 수: 1
Walter Roberson
2016년 7월 24일
Note: there are several File Exchange contributions that are more efficient versions of that code, such as https://www.mathworks.com/matlabcentral/fileexchange/22354-glcm-features4-m--vectorized-version-of-glcm-features1-m--with-code-changes-
Nensi Tallamma
2016년 8월 10일
0 개 추천
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
Walter Roberson
2016년 8월 10일
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 colorado.edu; it looks like you can find the source code at http://paos.colorado.edu/research/wavelets/software.html
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 MATLAB77.zip Communications_Toolbox42.zip Signal_Processing_Blockset68.zip Signal_Processing_Toolbox610.zip
I downloaded them all and installed. But when installing, it alerted me that no Simulink. How should I handle this?
댓글 수: 1
Walter Roberson
2016년 10월 11일
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.
0460051 NCTU
2016년 10월 11일
0 개 추천
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?
댓글 수: 7
Walter Roberson
2016년 10월 11일
You need to create the arduino object on each worker that needs to access arduino. As you probably only have one arduino, that should probably be only one worker. In turn that probably makes it most likely that you would use SPMD with the arduino code in a section protected by testing for one particular lab number; the other labs might or might not use labSend to send information to that lab for it to process on their behalf.
0460051 NCTU
2016년 10월 11일
How to create the arduino object on each worker?
I tried SPMD with my code.However,it was the same.
Walter Roberson
2016년 10월 11일
You call arduino() with the appropriate COM port. Remember that any one arduino device can only be communicated with from one worker.
If necessary, in your main routine you could call
fullpathToUtility = which('arduinoio.internal.Utility');
if isempty(fullpathToUtility)
% arduino Support package not installed - Error.
error( getString( message( 'MATLAB:hwstubs:general:spkgNotInstalled', 'MATLAB Arduino', 'ML_ARDUINO')) );
end
poolobj = gcp;
addAttachedFiles(poolobj, arduinoio.SPPKGRoot);
John Abh
2016년 10월 22일
when i was trying to run a .m file related to emd, i got Undefined function 'fmsin' for input arguments of type 'double'.so how can i fix it????
Walter Roberson
2016년 10월 22일
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
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
2016년 10월 23일
indah octaviyani
2016년 10월 26일
0 개 추천
i got this error,, could you help me?
Undefined function 'generateExplicit' for input arguments of type 'MPCController'.
댓글 수: 3
Walter Roberson
2016년 10월 26일
It appears you would probably want generateExplicitRange or generateExplicitMPC; see https://www.mathworks.com/help/mpc/ug/explicit-mpc-control-of-a-single-input-single-output-plant.html
indah octaviyani
2016년 10월 26일
편집: indah octaviyani
2016년 10월 26일
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'.
Walter Roberson
2016년 10월 26일
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.
nikhil kumar
2017년 2월 22일
0 개 추천
I am getting this error when i run some files: Undefined function 'matplot2' for input arguments of type 'double' Error in Figure4_14 (line 42) matplot2(X,Y,abs(ISAR),20); Please help me out guys.
댓글 수: 1
Walter Roberson
2017년 2월 22일
matplot2() is not part of any MATLAB toolbox or any entry in the File Exchange.
quach tien toan
2017년 5월 14일
0 개 추천
i got this error,, could you help me? Undefined function 'getsnapshot' for input arguments of type 'double'.
댓글 수: 1
Stephen23
2017년 5월 14일
As the getsnapshot documentation clearly states, its input must be a video input object. Your error message tells us that you are not giving getsnapshot a video image object, but a numeric value. You need to give it the right kind of input (the one that the documentation tell you that it requires).
Markes Jak
2017년 5월 24일
편집: Walter Roberson
2017년 5월 24일
0 개 추천
Error:Undefined function ‘execute’ for input arguments of type ‘double’.
raspberry pi simulink
Causes
Actually this can happened by many problems, one of them could be, the Simulink Support Package files didn’t downloaded correctly and may be there are missing file, and to be sure of that write:
which functionName
for example which execute
and see what will be the result. If it returns the comment “Has no license available” or just gives error , then follow the below soution and if returns with path and a name of the file ,then restart your matlab and check ,if not solved it could be another problem.
solution
Download all the package again, but before doing it, you have to remove SupportPackages folder in the following path: C:\Users\your_pc_ userrname\Downloads\MathWorks and start downloading the package ,it will works and mathworks will download the all the rquired files in that path for size not less that 716MB
i just restarted my pc and matlab and every thing works well ,thanks to these maklab team people http://www.maklabacademy.com/error-simulink-support-package-raspberry-pi-hardware-2016-2017/
Toke Frederiksen
2017년 6월 2일
0 개 추천
In my case I was simply not in the correct working directory. Changed by either CD'ing into the correct directory, or using the UI to change working directory.
lakshmi priya
2017년 8월 19일
0 개 추천
Undefined function 'partiald' for input arguments of type 'double'. please give me answers
댓글 수: 1
Walter Roberson
2017년 8월 19일
편집: Walter Roberson
2017년 8월 19일
lakshan tharuka
2017년 9월 22일
0 개 추천
I get the followig error.Could you please give an answer
Undefined function 'readFunctionTrain' for input arguments of type 'char'.
댓글 수: 2
Steven Lord
2017년 9월 22일
If you're trying to run the example from this blog post, you will need to download this File Exchange submission. I recommend using the Add-Ons manager to add it to your MATLAB installation (search for "deep learning 10 lines") or you can download it and manually put it in a directory on your path.
Note that the requirements state this requires Image Processing Toolbox and Neural Network Toolbox, so make sure you have those products installed.
lakshan tharuka
2017년 9월 22일
편집: lakshan tharuka
2017년 9월 22일
It worked.Thanks steven! But unfortunately requires 3.0 GPU
divyasami27
2018년 3월 12일
When I try:
which envelope
I get 'envelope' not found, this is in version R2014a.
댓글 수: 1
Walter Roberson
2018년 3월 12일
That suggests you do not have the Signal Processing Toolbox installed.
babita verma
2018년 4월 5일
편집: babita verma
2018년 4월 5일
0 개 추천
I get the following error when I try to use mattest for tscore calculations:
Undefined function 'bioinfochecknargin' for input arguments of type 'double'
Can anyone explain why would this error occur and suggest a solution? Any help is appreciated, thanks.
댓글 수: 1
Steven Lord
2018년 4월 5일
That is a utility / helper function in Bioinformatics Toolbox. Check the output of the ver function to determine if you have that toolbox installed.
Marco Nesci
2018년 5월 28일
0 개 추천
I got this message,
Undefined function 'kalman' for input arguments of type 'double'
I controlled all the licenses and the function is present in its controldesign folder How can I solve it?
댓글 수: 5
Andreas Goser
2018년 5월 28일
Please run the following and post the results
which kalman -all
license('test','Control_Toolbox')
vikash joshi
2023년 3월 14일
i had the same issue. ran the above script which gave output 1. what next?
vikash joshi
2023년 3월 15일

Walter Roberson
2023년 3월 15일
Could you confirm that
which -all kalman
comes up empty?
If so then try
restoredefaultpath; rehash toolboxcache
if it starts working then savepath and if it does not start working then reinstall the Control System Toolbox
Metin Ozturk
2018년 7월 31일
0 개 추천
It may be because the function you are trying to use is not available in your current MATLAB version. For example, if you use 'normalize' function in any version other than 2018, it will produce the same error, as the 'normalize' function was introduced in MATLAB 2018.
sena pathy
2018년 8월 16일
0 개 추천
Undefined function 'rescale' for input arguments of type 'double'. please help me with this error
댓글 수: 1
Asry Noorsal
2018년 9월 29일
0 개 추천
hi there~ i have an error like this one "Undefined function 'ziegler_nic' for input arguments of type 'double'." i've added some file to the path but it still won't work. it will be a big help for me if anybody can solve this case, thanks before
댓글 수: 3
Walter Roberson
2018년 9월 29일
ziegler_nic is an internal function to pid_design of https://www.mathworks.com/matlabcentral/fileexchange/18-ctrllab
You would not be expected to call this routine yourself, and if you did call it then MATLAB would not be able to find it because it is internal to the other function.
Asry Noorsal
2018년 10월 2일
so this is not related with any toolbox?
Walter Roberson
2018년 10월 4일
It is not related to any toolbox.
clpi
2019년 7월 3일
0 개 추천
Hello !
I have a matlab function which at a certain point calculates sin(2*pi*freq*t_array) (t_array in an array of size (1,2000).
I tried to call this function vi matlab.engine but I got the error message: "Undefined function 'sin' for input argument of type 'int64' "
I tried what is people suggested in this topic but it didn't work. I wanted to add the file 'sin.m' to my working directory but it is not a function script, it is a simple text.
I would be very grateful of any help
Thank you !
댓글 수: 2
Guillaume
2019년 7월 3일
Please start your own question if you need help. sin is indeed not defined with inputs of type int64. Convert your input to double. If your number is so large that it looses precision when converted to double (i.e. it is greater than flintmax) then why are you calculating the sinus of such large numbers?
Philippe Lebel
2020년 1월 9일
he needs to see what's at the end of the sine wave!
Mosaic PCS
2020년 2월 7일
0 개 추천
I am getting this error .plz help
Undefined function 'series' for input arguments of type 'double'.
댓글 수: 2
Walter Roberson
2020년 2월 7일
There is a series() call in the Control Systems Toolbox but it must be passed control systems not numeric values.
I speculate that you are using series() from some third party code and that it expects some kind of representation of a formula, perhaps symbolic, perhaps a function handle.
One possibility is that you are using symbolic code from r2007a or earlier that was based upon the maple software engine and you passed numeric values instead of symbolic.
Walter Roberson
2026년 1월 18일
Or perhaps you intend to be calling the series() function of the symbolic toolbox, but accidentally you are passing a numeric value instead of a symbolic expression or symbolic function.
Jithin Nambiar J
2021년 4월 10일
It sometimes gives you this error if you don't have the right toolboxes installed for the certain function.
If a particular function is causing an error. Try typing
help functionName
If this results in like a certain toolbox is required for this function to work. Just click on the hyperlink or underlined link which is given in the terminal.
It will direct you to the appropriate package. Make sure you save any programs. Since installing the packages requires MATLAB to restart.
Cheers !!
Bingo Bongo
2021년 6월 18일
0 개 추천
I am get the following error
Undefined function 'trainNetwork' for input arguments of type 'double'
Iam trying the Time series forecasting using deep learning example(Chickenpox) code.
iam using version R2012b of Matlab
댓글 수: 2
Walter Roberson
2021년 6월 18일
R2012b had absolutely no support for Deep Learning.
To do Deep Learning in R2012b, you have two choices:
- Write all the code yourself; or
- find a third-party library and use loadlibrary() to link to it
The first Deep Learning support was added in R2016a, and there has been a lot of upgrades of the Deep Learning support since that time; if you need to do Deep Learning then I highly recommend that you get a new version of MATLAB.
Bingo Bongo
2021년 6월 20일
Noted. Thank you
Mohamed Zewail
2021년 10월 28일
0 개 추천
I also got a similar problem with ONNX function,
Undefined function 'rearrangeONNXWeights' for input arguments of type 'single'.
댓글 수: 6
Mohamed Zewail
2021년 10월 28일
I used
which rearrangeONNXWeights
and did not find a path to this function, how could I find this function and add the path to matlab
Mohamed Zewail
2021년 11월 6일

this step is where I got the error, any advice? and thanks for the help
Walter Roberson
2021년 11월 6일
The code for the function is where I linked. Copy the posted code to appropriate .m files.
Mohamed Zewail
2021년 11월 6일
oh I thought its built in the toolbox, thanks a lot.
Walter Roberson
2021년 11월 6일
It is built in to the toolbox, for new enough releases. However you did not mention which release you are using, and it was faster for me to show you where you could find the exact code than it was for us to go back and forth about releases and exactly where the master copy of the code is stored, and exactly which command you are using and so on. I cut through all those steps by giving you a link to the exact code.
카테고리
도움말 센터 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!