undefined function or varaible

Hi,
Every time i run my file, it comes up with an error 'undefined function or variable (variable name). However, the name of the function is the old name of the file, i called it attempt2, however, i managed to get a good start on my project, so renamed the file to something else, and did a search and replace with everything attempt2. The error still happens

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 28 日
編集済み: madhan ravi 2018 年 12 月 28 日

0 投票

The function has to be save in a separate file with the same name of a function if your using prior 2016b but since 2016b a script file can contain a function at the very end of the file.
Note: The file names should be unique not repeated (meaning the script file and the function name shouldn't be the same) .
doc function % read it

4 件のコメント

Samuel Crofts
Samuel Crofts 2018 年 12 月 28 日
Hi,
Thank you for your reply,
Not quite following what you mean, attempt2 no longer exists, the m file is attempting to run it even though i have replaced it with something else
madhan ravi
madhan ravi 2018 年 12 月 28 日
please attach your files
Samuel Crofts
Samuel Crofts 2018 年 12 月 28 日
Thank you
madhan ravi
madhan ravi 2018 年 12 月 28 日
ok so it's related with gui maybe someone else can help

この質問は閉じられています。

タグ

質問済み:

2018 年 12 月 28 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by