Undefined Function or Variable 'FunctionNameHere'
2 次查看(过去 30 天)
显示 更早的评论
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
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
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
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
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
Ok so this script's name is Untitled.m
I get following error message
>>Untitled
Undefined function or variable 'Untitled'.
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
\\fs1\homes\ziogioan\My Documents\MATLAB\Untitled.m % Has no license available
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
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
2020-4-21
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
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
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
2020-4-21
okay, please start MATLAB, run plot(1:10) and paste the complete error message.
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
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
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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
