You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Undefined Function or Variable 'FunctionNameHere'
2 views (last 30 days)
Show older comments
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?
Answers (1)
Fangjun Jiang
on 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 Comments
Ioannis Ziogas
on 20 Apr 2020
Ok i have license for various toolboxes , but license('inuse') returns only matlab.Also how can the license('test','FuncNameHere') return no license?
Fangjun Jiang
on 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
on 21 Apr 2020
Hmm thanks i think i understand this...By typing license('inuse') command i get back answer matlab.So I assume I dont have license for any toolboxes,just for the basic(?) stuff matlab offers.So i create a simple script like x = 1:10;
y= 10 :20;
y= y(:);
t = x*y;
plot(t,x)
And i still get this error , although i am not using any function that belongs to a toolbox
Rik
on 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
on 21 Apr 2020
Ok so this script's name is Untitled.m
I get following error message
>>Untitled
Undefined function or variable 'Untitled'.
Rik
on 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
on 21 Apr 2020
\\fs1\homes\ziogioan\My Documents\MATLAB\Untitled.m % Has no license available
Fangjun Jiang
on 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
on 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
on 21 Apr 2020
Dear Fangjun Jiang,
unfortunately it's not the file name that creates the problem,as i said every one of my scripts has similar behavior,i used this as an example.Here is another one
InputOutput.m
%Data Length
N=2048;
%MA-parameters
b=[1 0.93 0.85 0.72 0.59 -0.1];
b=b(:);
%Input:White non-Gaussian Noise : Exponential Distribution with unit mean
%exprnd:generates random exponential numbers with given mean,where vector
%[1,2048] is size(v)
v=exprnd(1,[1,2048]);
%Output/For k<0,v(k) is taken as 0(Arxikes sinthikes=0)
x=zeros(1,N);
for k=1:N
for i=1:6
if (k+1-i<=0)
x(k)=x(k);
else
x(k)= x(k)+b(i)*v(k-i+1);
end
end
end
filename = 'InputOutput.mat';
save('InputOutput.mat')
Command which InputOutput - all gives same result
\\fs1\homes\ziogioan\My Documents\MATLAB\InputOutput.m % Has no license available
Ioannis Ziogas
on 21 Apr 2020
Dear Image Analyst,
i have contacted them but they are much slower than you guys lol :P.Unfortunately i too think that it is a license problem
Fangjun Jiang
on 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
on 21 Apr 2020
I dont quite understand what you suggest that I do.This error happens every time i try to run something,so basically i can't do anything.I have quit and re-started MATLAB many times since that error appeared.I dont get any pop-up warnings though.
Fangjun Jiang
on 21 Apr 2020
okay, please start MATLAB, run plot(1:10) and paste the complete error message.
Fangjun Jiang
on 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
on 22 Apr 2020
It seems that moving the script to a different folder solved the problem.Thanks a lot Fangjun Jiang and also other guys for your help!! :)
Fangjun Jiang
on 22 Apr 2020
Edited: Fangjun Jiang
on 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
on 22 Apr 2020
No there wasnt such a file,but i think the problem was that i had some functions from toolboxes that i didnt have license for.
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)