Undefined Function or Variable 'FunctionNameHere'
Ältere Kommentare anzeigen
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?
Antworten (1)
Fangjun Jiang
am 20 Apr. 2020
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 Kommentare
Ioannis Ziogas
am 20 Apr. 2020
Fangjun Jiang
am 21 Apr. 2020
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
am 21 Apr. 2020
Rik
am 21 Apr. 2020
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
am 21 Apr. 2020
Rik
am 21 Apr. 2020
Is this file stored in the current directory?
What is the output of the line below?
clc,which Untitled -all
Ioannis Ziogas
am 21 Apr. 2020
Fangjun Jiang
am 21 Apr. 2020
"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
am 21 Apr. 2020
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
am 21 Apr. 2020
Ioannis Ziogas
am 21 Apr. 2020
Fangjun Jiang
am 21 Apr. 2020
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
am 21 Apr. 2020
Fangjun Jiang
am 21 Apr. 2020
okay, please start MATLAB, run plot(1:10) and paste the complete error message.
Ioannis Ziogas
am 22 Apr. 2020
Fangjun Jiang
am 22 Apr. 2020
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
am 22 Apr. 2020
Fangjun Jiang
am 22 Apr. 2020
Bearbeitet: Fangjun Jiang
am 22 Apr. 2020
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
am 22 Apr. 2020
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!