How to resolve an error message: Unrecognized function or variable

조회 수: 1 (최근 30일)
Telema Harry
Telema Harry 2021년 8월 13일
댓글: Rik 2021년 8월 14일
I always get an error of Unrecognized function 'DA' when I run the code for the first time.
The error disappears in subsequent runs. What could be the reason.
see a sample of the code.
%% ENTER DATE, MONTH, YEAR AND HOUR
DA.Day = 1;
DA.Month = 06;
DA.Year = 2021;
DA.tLST = 7;
DA.ls = 60;
[tim, yprime] = Balloondynamics(dtspan,In0,wind, DA, I, B);
  댓글 수: 5
Telema Harry
Telema Harry 2021년 8월 13일
I have seen the bug. It took a while but I was able to find it.
after the DA variable, I called another file to load weather data.
That file clears all the previous variables using the function: clearvars -except data
In the next attempt, the program uses the stored 'data' and it is not runing the weather data file again.
Problem solved. Thanks
Rik
Rik 2021년 8월 14일
That sounds like you just learned why functions are useful.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by