Why do I get the error "Unrecognized function or variable"?

10,330 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2012 年 2 月 27 日
コメント済み: Walter Roberson 2023 年 2 月 2 日
I am receiving one of the following error messages. How can I resolve this issue?
Undefined function or variable ‹Name›.
Unrecognized function or variable ‹Name›.
Undefined function or method ‹Name› for input arguments of type ‹ClassName›.

採用された回答

MathWorks Support Team
MathWorks Support Team 2022 年 12 月 7 日
編集済み: MathWorks Support Team 2022 年 10 月 24 日
MATLAB does not recognize the specified string as the name of a function on the MATLAB path or as a variable. The above error messages can be caused by:
1) Trying to use a variable that has not been defined before this line of code executes.
>> x=1:10;
>> t=x.^2;
>> plot(x,y)
Undefined function or variable 'y'.
% Possible corrections:
% Change line 3 to "plot(x,t)"
% or Change line 2 from "t=x.^2;" to "y=x.^2;"
2) A typographical error when typing a function or variable name. However, later versions of MATLAB try to resolve these typos with “Did you mean” suggestions. For example,
>> foo = 42;
>> fo0
Undefined function or variable 'fo0'.
Did you mean:
>> foo
3) The wrong case for a function or variable name. Later versions of MATLAB try to resolve these typos with “Did you mean” suggestions.
4) Changing directories so that a function you used is no longer on the MATLAB path.
5) Trying to use a function for which you are not licensed or that belongs to a MathWorks toolbox that isn’t installed. In later versions of MATLAB, this is not an “Undefined function or variable” error, and MATLAB lets you know that you are either not licensed to use the function or the appropriate toolbox is not installed.
6) Trying to use a function that belongs to a third-party toolbox that isn’t installed.
7) Trying to use a function that does not yet exist in your version of MATLAB.
8) Trying to use a function that has been removed from your version of MATLAB. In later versions of MATLAB, this is not an “Undefined function or variable” error, and MATLAB lets you know the new, preferred function to use.
9) Trying to use a variable that gets cleared from the workspace because your script or function contains "clear all" or "clearvars".
10) Calling an object method without an object as the first input.
11) Using a MEX function that is compiled on a platform different from the one in use.
 

Try the following:

1) Verify that the undefined function or variable is visible (it is on the path or in the current workspace) and that it has been defined before this line of code executes. If the undefined identifier is a function, the 'which' function can help you verify that it is visible to the function where the error occurs:https://www.mathworks.com/help/matlab/ref/which.html
2) Verify that the function that you are trying to use is available in your version of MATLAB using the built-in documentation (>> doc). If you cannot find it in our documentation, the function may have been added in a later release of MATLAB, or it may be part of a third-party toolbox that is external to MathWorks.
3) If you are trying to use a function that should be available in your version of MATLAB, from a MathWorks toolbox that you have installed and licensed for, there may be a problem with your MATLAB search path. Run the following MATLAB commands to restore it:
>> restoredefaultpath % This will remove any custom paths
>> rehash toolboxcache
>> savepath
See our documentation for more tips:
  5 件のコメント
Walter Roberson
Walter Roberson 2022 年 10 月 25 日
There is a related but slightly different message that can easily be mistaken for this message.
In new enough versions of MATLAB, inside a function, if you call a function and you then assign to a variable with the same name as the function, and you then use that name, then MATLAB will know that the function is out of scope (because the variable has that name), but it will also have locked-in the idea that the name is a function rather than a variable. The reference to the name then generates an "Undefined function" message. Notice that the message does not continue on to "or variable".
This behavior can be difficult to understand, as the name might clearly have been assigned to.
For example
function test
a = sum(1:10); %use as function
sum = ones(1,5); %now a variable
sum(2:3)
This can generate undefined function on the reference to sum.
If you had assigned to sum before calling sum as a function, and then you cleared the variable and then tried to use sum as a function, then you would get a related error message.
Inside a function it is no longer permitted to change a name between function and variable.

サインインしてコメントする。

その他の回答 (55 件)

Alex Alex
Alex Alex 2018 年 4 月 10 日
Undefined function or variable 'shaperead'. On the description page for this function it says "Introduced before R2006a". I use MATLAB R2015b- academic use. Does that mean that the function is not available for student license? How can I perform this kind of check in the future? Many thanks, Alex.
  1 件のコメント
Florian Morsch
Florian Morsch 2018 年 4 月 11 日
Type "ver" into the Matlab Command Window. shaperead is part of the Mapping Toolbox, if you dont own it you cant use the function. Normaly it should be included in the academic license, so check if you have downloaded it. If not you may try to load it.
If its not for free in your version you may try to contact your IT so it can be included into the license.
Otherwise, if you have newly created the code try to restart matlab once, sometimes that helps, too.
Best regards

サインインしてコメントする。


Saadia Talay
Saadia Talay 2018 年 5 月 21 日
編集済み: Walter Roberson 2020 年 5 月 31 日
Undefined function or variable 'lgemri' when I enter the following:
[X,meta]=nrrdread(lgemri);
The nrrdread function has been taken from the matlab file exchange: https://www.mathworks.com/matlabcentral/fileexchange/34653-nrrd-format-file-reader
The lgemri is a file in nrrd format.
  2 件のコメント
Saadia Talay
Saadia Talay 2018 年 5 月 23 日
Thanks! That was stupid of me.

サインインしてコメントする。


Iman Tahamtan
Iman Tahamtan 2018 年 3 月 25 日
I am facing this error when running y_lambda=lambda: Undefined function or variable 'lambda'.
  2 件のコメント
Liam Cawley
Liam Cawley 2021 年 9 月 27 日

サインインしてコメントする。


ishwarya ramesh
ishwarya ramesh 2018 年 3 月 27 日
Undefined function or variable 'drivingScenario'. why do i get this error i just need a clear explanation
  4 件のコメント
Walter Roberson
Walter Roberson 2021 年 10 月 10 日
According to your question https://www.mathworks.com/matlabcentral/answers/1469696-unrecognize-position-function?s_tid=srchtitle you were trying to use a variable named position not a function named position

サインインしてコメントする。


Liliana Malik
Liliana Malik 2018 年 4 月 6 日
why do i get Undefined function or variable 'pixelLabelDatastore' and Undefined function or variable 'batchNormalizationLayer'
  5 件のコメント
Walter Roberson
Walter Roberson 2018 年 6 月 22 日
Yes, batchNormalizationLayer needs R2017b.

サインインしてコメントする。


tim jelly
tim jelly 2018 年 4 月 12 日
When trying to make a GUI i get the error:
Undefined function or variable 'radioChanged'
Error while evaluating ButtonGroup SelectionChangedFcn.
I dont have "radioChanged" in my code so how do I fix this, thanks
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 4 月 12 日
What shows up if you use
radios = findall(0, '-property', 'SelectionChangedFcn');
get(radios, 'SelectionChangedFcn')

サインインしてコメントする。


Francisco Santamaría
Francisco Santamaría 2018 年 6 月 23 日
編集済み: Francisco Santamaría 2018 年 6 月 23 日
for i=1:(npop+1)
dron(i,:)=rand(1,nvar).*(xmax-xmin)+xmin;
cost(i)=CostfunctA3(dron(i,:));
dron_cost(i,:)=[dron(i,:) cost(i)]
end
When trying to make a run i get the following error:
Undefined function or variable 'CostfunctA3'.
  1 件のコメント
Stephen23
Stephen23 2018 年 6 月 23 日
編集済み: Stephen23 2018 年 6 月 23 日
@Francisco Santamaría: have you defined/downloaded a function named CostfunctA3? Is it on the MATLAB path?

サインインしてコメントする。


Waqas Waqas Ul Hussan
Waqas Waqas Ul Hussan 2018 年 8 月 23 日
編集済み: Walter Roberson 2018 年 8 月 24 日
hi
I am getting this problem in Matlab when plotting the graphs with shaded area.
Undefined function or variable 'jbfill'.
These below are my code lines. error is in line 127 below.
  7 件のコメント
yousra aichoun
yousra aichoun 2020 年 5 月 6 日
hi ,
can you help me please i'm having the same problem but with simulink ,once i run the simulation , it display :Undefined function 'modelRegistry' for input arguments of type 'PmSli.RunTimeModule'.

サインインしてコメントする。


Dhruba Raj Dhakal
Dhruba Raj Dhakal 2017 年 6 月 30 日
Moved: Stefanie Schwarz 2022 年 10 月 24 日
Why this error occurs when I use antenna toolbox???
  4 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 31 日
Moved: Stefanie Schwarz 2022 年 10 月 24 日
eeli Sai Krishna: please give more information about what code you are executing, and which MATLAB release you are using.

サインインしてコメントする。


David Akin
David Akin 2018 年 11 月 1 日
編集済み: David Akin 2018 年 11 月 2 日
Same error but using a Mathworks example. Here's the contents of fact.m
function f = fact(n)
f = prod(1:n);
end
Located here:
/opt/software/MATLAB/2018a/toolbox/local/fact.m
When trying to use:
>> y=fact(5);
Undefined function or variable 'fact'.
I cd'ed to the directory containing the file before starting MATLAB and it's in the search path:
>> path
MATLABPATH
/opt/software/MATLAB/2018a/toolbox/local
.
.
.
Any suggestions?
>> dos('cat /opt/software/MATLAB/2018a/toolbox/local/fact.m');
function f = fact(n)
f = prod(1:n);
end
  4 件のコメント
Steven Lord
Steven Lord 2018 年 11 月 2 日
Do not store your own files in a directory under the matlabroot directory. See this documentation page for some of the reasons why. If you must do so, that documentation page will also tell you how you can.
Consider storing your files in your userpath folder instead.

サインインしてコメントする。


David Akin
David Akin 2018 年 11 月 1 日
It's an example only, as I've got some code from a colleage (a collection of .m files) I'd like to use. However it's not finding the functions. Thank you though.

michael
michael 2018 年 11 月 14 日
(Matlab R14)
Something strange is that when I try to call some function from toolbox (communication) I'm getting that it is not existing.
Even when I'm going to %MATLABROOT%\toolbox\comm\comm where the m file is existing, I still can't run it.
Please suggest what is the issue
  2 件のコメント
Hector Diaz
Hector Diaz 2020 年 3 月 27 日
Thanks for the advice!!, it works perfectly to solve the problem!!

サインインしてコメントする。


Darrell
Darrell 2019 年 2 月 6 日
I have seen this issue before with other functions. As stated before, first check that the function name is spelled correctly and that the function is located in the matlab search path. Assuming those two things check, then delete the path where the function is located, then reset the path. I would also will restart Matlab. I'm not sure why, but this seems to correct the problem.

Al3jandro
Al3jandro 2019 年 6 月 24 日
Hi.
I'm making this rutine, but i cant get values of K, how can I resolve this issue?
clear;
clc;
A=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','B1:B6');
I=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','C1:C6');
E=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','D1:D6');
W=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','u1:u6');
L=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','Q1:Q6');
a=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','R1:R6');
n=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','V3');
nGDL=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','NUDOS','J2');
GDLG=xlsread('ANÁLISIS DE ESTRUCTURAS _ INPUT2','BARRAS','K2:P4');
for i=1:n
A=A(i);
I=I(i);
E=E(i);
L=L(i);
a=a(i);
KL(i)=[E*A/L 0 0 -E*A/L 0 0;0 12*E*I/L^3 6*E*I/L^2 0 -12*E*I/L^3 6*E*I/L^2;0 6*E*I/L^2 4*E*I/L 0 -6*E*I/L^2 2*E*I/L;-E*A/L 0 0 E*A/L 0 0;0 -12*E*I/L^3 -6*E*I/L^2 0 12*E*I/L^3 -6*E*I/L^2;0 6*E*I/L^2 2*E*I/L 0 -6*E*I/L^2 4*E*I/L];
T(i)=[cos(a) sin(a) 0 0 0 0;-sin(a) cos(a) 0 0 0 0;0 0 1 0 0 0;0 0 0 cos(a) sin(a) 0;0 0 0 -sin(a) cos(a) 0;0 0 0 0 0 1];
KG(i)=T(i)'*KL(i)*T(i);
G=[GDLG(i,1) GDLG(i,2) GDLG(i,3) GDLG(i,4) GDLG(i,5) GDLG(i,6)];
KT=zeros(nGDL,nGDL);
KT(G,G)=KG(i);
if i==1
K=zeros(nGDL,nGDL);
end
K=K+KT;
end
disp(K)
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 6 月 24 日
A=A(i) replaces the array A with a single scalar value. After the statement, A is size 1x1 and it is not possible to access A(2)

サインインしてコメントする。


clpi
clpi 2019 年 7 月 3 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Hello !
I have a matlab function which at a certain point calculates sin(2*pi*freq*t_array) (t_array in an array of size (1,2000).
I tried to call this function via matlab.engine but I got the error message: "Undefined function 'sin' for input argument of type 'int64' "
I wanted to add the file 'sin.m' to my working directory but it is not a function script, it is a simple text.
I would be very grateful of any help
Thank you !

Regina Vivian Barli
Regina Vivian Barli 2019 年 7 月 8 日
Hello, I happen to stumble upon similar problem.
So I have been trying to use matlab for video stabilising, but keep getting this error:
Undefined function or variable 'cvexEstStabilizationTform'.
even though I have followed Matlab's instruction by running a command by clicking
edit cvexEstStabilizationTform.m
Can anyone please suggest me what to do?
Kind regards
Vivian

Ashwanth Ramesh
Ashwanth Ramesh 2019 年 10 月 18 日
I am trying to upload audio data into matlab using audioDatastore funtion and the same error pops up. Please help!
Screenshot (102).png
  2 件のコメント
Ashwanth Ramesh
Ashwanth Ramesh 2019 年 10 月 21 日
okay, thank you so much..

サインインしてコメントする。


Sara Alkhaldi
Sara Alkhaldi 2020 年 1 月 29 日
The functions stepseq, impseq, and nextpow2 do not work in the MATLAB R2018B and I don't know why. Can someone please help?
Screen Shot 2020-01-29 at 4.15.16 PM.png
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 1 月 29 日
nextpow2 should be part of MATLAB but the other two are from a book https://www.mathworks.com/matlabcentral/fileexchange/2189-digital-signal-processing-using-matlab

サインインしてコメントする。


abood qamar
abood qamar 2020 年 4 月 1 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
can please help me to solve this problem
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 4 月 1 日
Is this related to MIMO-OFDM Wireless Communication with Matlab book?

サインインしてコメントする。


apri zulham
apri zulham 2020 年 4 月 19 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
i need help!!
Undefined function or variable 'imaghwinfo'.
Error in CAMERA_MATLAB>pushbutton1_Callback (line 81)
IAHI = imaghwinfo;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in CAMERA_MATLAB (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)CAMERA_MATLAB('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
81 IAHI = imaghwinfo;
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 4 月 20 日
The proper function name is imaghwinfo . You need to change line 81 of CAMERA_MATLAB.m

サインインしてコメントする。


CS
CS 2020 年 4 月 20 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Undefined function or variable 'readmatrix'.
I have a basic_matrix.txt file including
6,8,3,1
5,4,7,3
1,6,7,10
4,2,8,2
2,7,5,9
I want to read the contents of this file (basic_matrix.txt). When I write
M = readmatrix('basic_matrix.txt')
MATLAB gives an error as
Undefined function or variable 'readmatrix'.
M = readmatrix('basic_matrix.txt')
Does anyone know what the reason is?
I am just trying to implement what is written on https://www.mathworks.com/help/matlab/ref/readmatrix.html in order to read the contents of a file. I am using MATLAB R2018b.
Any help would be appreciated.
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 4 月 20 日
Or really for that file you could just load() the file.

サインインしてコメントする。


Alex Backer
Alex Backer 2020 年 4 月 24 日
This happened to me with mean and median when I indvertently called it mean(variable,:) instead of mean(variable,1).

José Moctezuma Rodríguez Santillán
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Undefined function or variable 'isfile'. You cannot find the isfile function in MATLAB R2015. any alternative to replace? this is my code;
options = weboptions('Username', 'insertusername', 'Password', 'insertpassword');
year = 2016;
month = 03;
time = 0900;
start_jd = 011;
end_jd = 045;
for jd = start_jd:end_jd
cd = day(datetime((year-1),12,31) + days(jd));
filename = ['SST' num2str(year) '_' num2str(jd) '.nc'];
if isfile(filename)
fprintf('already have the file |%s|\n',filename);
else
url=['https://data.nodc.noaa.gov/ghrsst/L4/GLOB/JPL_OUROCEAN/G1SST/2016/' num2str(year) '/' num2str(jd)];
outname=websave(filename,url,options);
fprintf('got weather data file |%s|\n',outname);
end
end
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 9 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Change
if isfile(filename)
to
if exist(filename, 'file')

サインインしてコメントする。


Yinying Wang
Yinying Wang 2020 年 5 月 16 日
Help!
I received "undefined function 'string2char' for 'char' type input arguments".
This error occurs only when I use mphload('filename') in an exe file. When in a .m file this line works well. I thought maybe mphload use 'string2char' function whatever its input argument type is. I use mphload("filename") instead. It still doesn't work...

Joey Porter
Joey Porter 2020 年 7 月 7 日
Hi all,
I've had this error after a newly created function would give this error even though it was in the correct path and was user-defined (so no problem with needing the correct toolbox or licencing).
The name of the function and the file name you save it as MUST BE THE SAME.
I had saved my function a different name and therefore gave this error. This tip isn't in the accepted answer's response so give this a try.
  6 件のコメント
Joey Porter
Joey Porter 2020 年 7 月 8 日
Okay, sure.

サインインしてコメントする。


soufiane kabiri
soufiane kabiri 2020 年 9 月 18 日
編集済み: Walter Roberson 2020 年 11 月 30 日
hi everyone, i hope you'll help me with that
i have the same error "Undefined function or variable 'HMMem'"
this the code:
function [Q, g, l] = HMMbaumwelch(y, nu, tol, maxIt, Q, g)
% HMMbaumwelch compute maximum likehood estimate using Expectation-Maximization
% iterations
%
% in : y = vector of observations
% nu = initial distribution of the hidden chain
% tol = tolerance for the stopping criterion
% maxIt = maximal number of iterations
% out : Q = estimate of the transition matrix of the hidden markov process
% g = estimated probabilities of transition: gh(x,y) = estimate of P(Y=y | X=x) for 1<=x<=k
% l = log-likelihood of y for parameters Q and g
%
% Example :
n = 10000;
nu = [0, 1];
Q = [0.8, 0.2; 0.1, 0.9];
g = [0.25 0.25 0.25 0.25; 0.05 0.05 0.45 0.45];
[x,y] = HMMsample(nu, Q, g, n);
[Qh, gh] = HMMem(y, nu);
% % compare estimates with truth: note that the order of the hidden
% % states may not be preserved
Q, Qh
g, gh
% References: Hidden Markov Models by Cappe, Moulines, Rydden
% Springer series in statistics
% by Aurelien Garivier, CNRS & Telecom ParisTech
% last revision February 7, 2012
global myfilter mysmoother % should be either HMMfilter/HMMsmoother, or HMMfilter_C/HMMsmoother_C
if nargin<4, maxIt = 100; end
if nargin<3, tol = 1e-4; end
k = length(nu); r = max(y); n = length(y);
Y = zeros(n, r); Y(sub2ind([n, r], 1:n, y))=1;
% if they are not provided, sample random initial transition and emission matrices
if nargin<5, Q = rand(k); Q = Q ./ (sum(Q, 2)*ones(1, k)); end
if nargin<6, g = rand(k, r); g = g ./ (sum(g, 2)*ones(1, r)); end
it = 0; oldQ = Q; oldg = g+tol+1;
while ((norm(oldQ(:)-Q(:), 1) + norm(oldg-g, 1) > tol) && (it<maxIt))
it = it + 1;
% compute the posterior distribution for the current parameters
[phi, c] = myfilter(y, nu, Q, g);
beta = mysmoother(y, Q, g, c);
post = phi .* beta;
% expectation of the number of transitions under the current parameters
N =Q.*(phi(:, 1:(end-1))*(beta(:, 2:end).*g(:, y(2:end))./(ones(k, 1)*c(2:end)))');
% expectation of the number of emissions
M = post * Y;
% re-estimation
oldQ = Q; oldg = g;
Q = N ./ (sum(N, 2) * ones(1, k));
g = M ./ (sum(M, 2) * ones(1, r));
end
l = sum(log(c));
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 30 日
Your code does not show any function definition for HMMen .

サインインしてコメントする。


islam dib
islam dib 2020 年 12 月 3 日
Undefined function or variable 'seriallist'.
release 2013b
what's wrong ?
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 12 月 3 日
serialport objects are a much newer release than what you have. You need to use serial() objects and https://www.mathworks.com/help/matlab/ref/instrfind.html

サインインしてコメントする。


AMAR Abdelhamid
AMAR Abdelhamid 2020 年 12 月 6 日
hello
i have this problem :
Error using mphload
Cannot find COMSOL server
how can i sole it, please.
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 12 月 6 日

サインインしてコメントする。


Muhd Farkhan
Muhd Farkhan 2020 年 12 月 7 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Hello, I'm having the same problem, here's my coding
where the error is at X = data_fault; , Im still new , do teach me
clc;
clear all;
load ('data_fault');
%load sample data
X = data_fault;
%train autoenc
autoenc = tranAutoencoder(X);
%reconstruct
XReconstructed = predict (autoenc,X);
%computing mseError
mseError = mse(X-XReconstructed)

Eamon Devlin
Eamon Devlin 2021 年 1 月 21 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
I have a probelm:
I have a list of varibles defined at the top of my script but when I am trying to create a function the defined variables (which are in the workspace too) are not being recognised.
%% Damped Oscillating Spring System
m_c = 2; %Container mass in kg
s1 = 16.0; % Spring constant, spring 1, N/m
s2 = 16.0; % Spring constant, spring 2, N/m
c = 2.0; % Damping Coefficient, Ns/m
d = 0.6; % Initial gap between mass and spring 2, m
t_total = 20.0; % Total interation time, s
dt = 0.01; % Interation Step, s
x =1; % Initial displacement, m
g = -9.81; % Gravitational Acceleration, m/s^-2
t = 0: dt: t_total; % Total Time for plotting graphs
r_m = 0.1; % Rate of mass of fluid change in kg/s
m_f_max = 4; % Maximum Fluid mass
%Then there is a choice menu and other calculations where the cases are all set out:
case {4} %Select if the containter is filled with fluid duing the simulation
[r_m] = fluidcalcs();
function [r_m] = fluidcalcs()
r_m = input('Rate of Change of Fluid Mass (kg/s)?\n\n');
if (r_m * t_total) > 4
disp('Invalid Entry - Maximum Fluid Mass is 4kg\n\n');
r_m = input('Rate of Change of Fluid Mass (kg/s)?\n\n');
end
end
In this case the 't_total' variable is not being recognised. The code works fine if I replace the variable name with the value. But the varables need to be changed each time so having a set value isn't what I want.
Any solutions?
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 1 月 21 日
That structure is not valid. case is only valid inside switch() but you cannot define a function inside of switch.

サインインしてコメントする。


Evelin Ponce
Evelin Ponce 2021 年 3 月 17 日
Maybe you should try to look for the function on the 'Add Ons' section so you could find the package which contains the function you need. All you have to do is to install the package.

khallad jobah
khallad jobah 2021 年 3 月 24 日
rigid3d function is not defined
my code : rigid3d(eye(3), [0 0 0])
  2 件のコメント
khallad jobah
khallad jobah 2021 年 3 月 25 日
Thanks, I figured that I have to update my Matlab ( it was 2019)

サインインしてコメントする。


JITHIN P M
JITHIN P M 2021 年 3 月 26 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
While running a mathlab code for Beamforming am getting the error as mentiond below,
" Unrecognized function or variable 'm_proj' "
Anyone who knows abouth this please help me to solve the issue. Due to this error my whole work is pending. Kindly please help me out.
  2 件のコメント
JITHIN P M
JITHIN P M 2021 年 3 月 26 日
Thankyou for our help

サインインしてコメントする。


Feng Chen
Feng Chen 2021 年 5 月 20 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Hi, I get the following error. Looking for solutions
Unrecognized function or variable 'xVOCap'.
Error in YTOwrapper (line 53)
res(ii).ap_auc = xVOCap(res(ii).rec, res(ii).prec);

Rupam Jaiswal
Rupam Jaiswal 2021 年 6 月 21 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Unrecognized function or variable 'CentroidTermX'.
what can i do?
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 6 月 21 日
[CentroidTermX,CentroidTermY]=find(ZTerm);
according to archives I find of Florence Kussener, The MathWorks % Application Engineer % August 2007

サインインしてコメントする。


Arnaud Yossa potawe
Arnaud Yossa potawe 2021 年 7 月 29 日
Anyone who knows abouth this please help me to solve the issue. Due to this error my whole work is pending. Kindly please help me out.
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 7 月 29 日
Sorry, I do not find any references to mbs_bode routine anywhere. Where did you find the code?

サインインしてコメントする。


MEGHA GUPTA
MEGHA GUPTA 2021 年 8 月 21 日
Unrecognized function or variable 'gen_gfdm' how to solve this problem in matlab simulator
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 8 月 21 日

サインインしてコメントする。


Amy Morris
Amy Morris 2021 年 8 月 22 日
I am getting 'Unrecognized function or variable 'dicm2nii'' when trying to use dicm2nii . Any suggestions for why this function isn't working?
  2 件のコメント
Amy Morris
Amy Morris 2021 年 8 月 22 日
That worked! Thank you so much!

サインインしてコメントする。


ABHISHEK MAURYA
ABHISHEK MAURYA 2021 年 9 月 9 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
while running vanet in matlab2021a in ubuntu desktop i am getting this error, I don't have any idea why this is happenning. Any valuable suggestion is welcome. Thank you!
Checking app_wsmp2msg_mex...
Checking phy_waveform2psdu_data_mex
phy_waveform2psdu_data_mex not found.
Unrecognized function or variable 'helperSubcarrierIndices'.
Error in phy_channelpacketDetection_data (line 17)
[data,pilots] = helperSubcarrierIndices(cfgnonHT,'HT');
Error in fcn_codeGen (line 28)
[pktOffset,cfgnonHT,outWaveform] = phy_channelpacketDetection_data(inWaveform,SNR,PSDULength);
Error in vanet_init (line 155)
fcn_codeGen
Error in fcn_runModel (line 24)
vanet_init();
Error in vanet>runButton_Callback (line 187)
fcn_runModel(simTime,roadtype,minVehicleNum,maxVehicleNum,gap,simRound,errBar,macTXT,appTXT,mapUI)
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in vanet (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)vanet('runButton_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.

Mariya Ali
Mariya Ali 2021 年 9 月 21 日
編集済み: Stefanie Schwarz 2022 年 10 月 24 日
Hi!
I am getting an error calculating the lyaprosen. The error I get is
Unrecognized function or variable 'dist'.
Error in lyaprosen (line 106)
Dmm=dist(EEMmm(:,1:k)')
  1 件のコメント