why am I getting error "Undefined function or variable"

조회 수: 1 (최근 30일)
Mallikarjun Yelameli
Mallikarjun Yelameli 2018년 5월 12일
답변: Mallikarjun Yelameli 2018년 5월 13일
I have defined a variable called "bestDimen". There is no error. I crosschecked many times. The script is also correct. It was working fine. But all of a sudden it starts giving following error.
"Undefined function or variable 'bestDimen'."
I am using "Matlab 2017a" Please reply fast. It's very urgent. I need help
  댓글 수: 3
Jan
Jan 2018년 5월 12일
Please read: Why your question is not urgent. Your chances to get a useful answer grow if you omit this term.
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 5월 12일
share your code, it easy to answer the problem exactly.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2018년 5월 12일
편집: Jan 2018년 5월 12일
"all of a sudden" - you can be sure, that this happens, because you instruct Matlab explicitly to delete the variable.
Without seeing the code, all I can do is guessing. I guess, that you are using scripts and any of the scripts contain a clear, clear vars or even worse a clear all statement.
Using scripts for productive work is a bad programming practice. Prefer functions, because they avoid polluting the workspaces and in consequence no clear 'ing is need.
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 5월 12일
Agree, learning sir @Jan
Jan
Jan 2018년 5월 12일
We are all learning in this forum. :-)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Mallikarjun Yelameli
Mallikarjun Yelameli 2018년 5월 13일
Thank you all for replying me so fast and early. The problem is solved when I restarted my computer and then Matlab started doing everything once again. Thank you so much to all of you. I appreciate your support.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by