Undefined function for input arguments of type 'char'.
498 次查看(过去 30 天)
显示 更早的评论
I have a GUI window with only two push buttons. Upon clicking the first, the callback will generate a uidir to select a folder from which to work. Then the file will be reformatted and saved as a collection of smaller files. This works well. The other pushbutton is simply intended to close this current window and open another. The problem is that when I open the figure and press pushbutton one i get the following error:
Undefined function 'Window_one' for input arguments of type 'char'.
Error in @(hObject,eventdata)Window_one('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
I have not used the handles structure in this window as there are no variable shared between callbacks and there is no figure to update. In my experience a shortage of or mistake in the declaration of handles is the reason for this error so I am slightly confused as to what the error might be caused by. Does anyone have any idea what may cause this error to arise? There are no cases on Mathworks answers of this having arisen in the same scenario with the error occurring with a GUI window.
I have attached the code along with this question
2 个评论
Muthukumar Gopalsamy
2020-5-30
"Undefined function for input arguments of type 'char'"
One of the possible reason for such error is if your file name contain white spaces.
Eg: window one.m is not valid instead window_one.m is valid.
This can be found be commenting all your routine and just empty file. Still error is thrown then its sure file name or directory where it exist not correct.
If not then one of your routine maybe not having function definition
Rishav Saha
2021-4-10
Thank you Muthukumar Gopalsamy. I had spaces in file name that's why it was not working.
回答(6 个)
Jan
2017-5-23
You have posted the code of the function Window_one. The error message shows, that the file "Windows_one.m" cannot be found. Has the code been saved to this file? Is there a typo in the file name? Is the file contained in one of the folders of your Matlab path?
2 个评论
Jan
2017-5-26
@Aaron: The error message is clear: The variable "myFile" has not been created before.
Guillaume
2017-5-23
I assume the callback itself is defined in the associated GUI figure.
One possibility is that by the time the callback is called, the current directory has been changed (with cd or through matlab gui) so your Window_one gui function is no longer on the path.
2 个评论
Muhammad Qasim Khan
2018-4-23
"!! Submission failed: Undefined function 'makeValidFieldName' for input arguments of type 'char'." please help me
HABTE TADESSE LIKASSA
2018-10-20
Undefined function 'norm' for input arguments of type 'char'.
Error in DRMF (line 31) Y1 = X/norm(X,'fro');
Please how can I tackle this problem, can u help me ?
1 个评论
Walter Roberson
2018-10-20
编辑:Walter Roberson
2022-12-17
This appears to be an unrelated question possibly involving https://ibug.doc.ic.ac.uk/resources/drmf-matlab-code-cvpr-2013/
shazil shoukat
2019-9-20
Undefined function 'Program' for input arguments of type 'char'.
this error occur when i run the code . what can i do
3 个评论
Preetam
2022-12-8
I'm also facing the same issue. If not by full path, how are we supposed to do the same?
aanshika singh
2021-5-26
Undefined function 'xlable' for input arguments of type 'char'.
Error in basic_signal (line 26)
xlable('\bfn')
1 个评论
Rik
2021-5-26
You forgot to ask a question and you posted this as an answer. Anyway, you probably mean xlabel instead of xlable.
Ismet
2022-12-17
>> parrotMinidroneCompetitionStart
Warning: Undefined function 'designfilt' for input arguments of type 'char'.
HOW CAN I FIX THAT ??*
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!