Undefined Function or Variable 'FunctionNameHere'
이전 댓글 표시
No matter what script i try to run , i get this error.I tried applied the corrections suggested here https://www.mathworks.com/matlabcentral/answers/96005-why-do-i-get-the-error-undefined-function-or-variable .When i try to see one of my script's full path with the which command , it returns the path along with a message %Has no license available.Last time i tried to run something was 3 hours prior this error and there was no problem at all with the same scripts.I have student's license and i'm using MATLAB with RemoteDesktopConnection from my Insitution's servers,so i dont think there is a problem with the license.Any idea what is going on?
답변 (1개)
Fangjun Jiang
2020년 4월 20일
It sounds like a license issue. You can find it out by running license() with various argument
license('inuse')
license('test','ToolboxName')
license('checkout','ToolboxName')
댓글 수: 19
Ioannis Ziogas
2020년 4월 20일
Fangjun Jiang
2020년 4월 21일
Licenses are managed according to toolbox, not according to functions. You may have the licenses on your server (like a book library) but may not be able to checkout one because others are using it. So use license('checkout','ToolboxName') before you running the script to make sure you obtain the license.
Ioannis Ziogas
2020년 4월 21일
Rik
2020년 4월 21일
Which of these lines causes the error? Run clc before running this code and paste the complete error message here in a comment.
Ioannis Ziogas
2020년 4월 21일
Rik
2020년 4월 21일
Is this file stored in the current directory?
What is the output of the line below?
clc,which Untitled -all
Ioannis Ziogas
2020년 4월 21일
Fangjun Jiang
2020년 4월 21일
"Untitled" is the name given to a MATLAB file that when it is saved, there is no file name specified. It should not be used for any meaningful script, function or model. Open the file to see if there is any useful content in it. If not, delete it. If yes, rename it and then delete this file and try again.
Image Analyst
2020년 4월 21일
I think you need to contact your institution, because it's saying that you don't have a license, not even for base MATLAB. So something's wrong. Maybe you didn't connect or authenticate properly.
Ioannis Ziogas
2020년 4월 21일
Ioannis Ziogas
2020년 4월 21일
Fangjun Jiang
2020년 4월 21일
When this error happens, quit MATLAB and then try to re-start MATLAB. MATLAB won't run if you can not checkout a MATLAB license. If your MATLAB is already running and you lost the MATLAB license (due to network interruption, idle too long, etc.), MATLAB will keep trying to checkout license and at the same time pop up warning every 3 minutes for 10 times and then quit.
Ioannis Ziogas
2020년 4월 21일
Fangjun Jiang
2020년 4월 21일
okay, please start MATLAB, run plot(1:10) and paste the complete error message.
Ioannis Ziogas
2020년 4월 22일
Fangjun Jiang
2020년 4월 22일
Move your script to a different folder and try it again. I wonder if you have some files (such as contents.m) in your "\\fs1\homes\ziogioan\My Documents\MATLAB" folder that caused it to think that this folder is for a toolbox that you don't have license for.
Ioannis Ziogas
2020년 4월 22일
Fangjun Jiang
2020년 4월 22일
편집: Fangjun Jiang
2020년 4월 22일
Could you check if there is a Contents.m in the folder \\fs1, \\fs1\homes, \\fs1\homes\ziogioan, ..., the whole folder chain? If yes, what is in it?
Ioannis Ziogas
2020년 4월 22일
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!