MATLAB Answers

Undefined function or variable

22 views (last 30 days)
joly Alipor
joly Alipor on 5 Jul 2020 at 16:55
Commented: joly Alipor on 5 Jul 2020 at 18:49
I've received a script, created a file and put the code in it. While running I receive this error. As it is a script (not a function), there should not be a problem. Does anybody can guide me?

  0 Comments

Sign in to comment.

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 5 Jul 2020 at 17:09
Edited: KALYAN ACHARJYA on 5 Jul 2020 at 17:12
As you mentioned that it is main scripts (Not associated function call). The error clearly stated that "Undefined function or variable"
May be you using the any custom function within the code, which is not defined in the current working directory Or you didnot defined any variable, before it is used. Please check it carefully or share the code, so that we can point the exact error.

  4 Comments

Show 1 older comment
KALYAN ACHARJYA
KALYAN ACHARJYA on 5 Jul 2020 at 17:35
Please us MTALAB version 2017b or more latest. I guess you are getting the "undefined function error" because of isfile.
Steven Lord
Steven Lord on 5 Jul 2020 at 17:39
Can you show us the full and exact text (including all the text displayed in red) of the error message you received?
joly Alipor
joly Alipor on 5 Jul 2020 at 18:49
Actually I changed the m.file's name and now the error is as follows:
Undefined function 'isfile' for input arguments of type 'char'.
Error in basic (line 44)
if isfile(strcat(inPrefix{z}, '.txt')) % Check if txt file exists, and continue if it does.

Sign in to comment.


Translated by