現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Undefined Function or Variable 'FunctionNameHere'
6 ビュー (過去 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!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)
