이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Undefined Function or Variable 'FunctionNameHere'
조회 수: 4 (최근 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 (한국어)
