Undefined function or variable
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I cannot see and thus make a correction for the following indefinition:
2) PREPARING DATA
********************************************************************
2.1) Creating domestic variables for each country
2.1b) Creating regions
Undefined function or variable 'create_region'.
Error in gvar (line 568)
[dv aggrwgts] = create_region(rnamesx(r), regionsx.(rnamesx{r}),nobs, vnum, vnames, dv, aggrwgts);
>> Undefined function or variable 'create_region'.
Undefined function or variable 'Undefined'.
채택된 답변
Image Analyst
2020년 5월 2일
0 개 추천
In the single line of code you chose to share, we see no variable called "Undefined". We do see a "create_region" functino being called, but why should MATLAB have any idea what that is. Did you write it? Or was given it as an m-file? Where is it? Is it on the search path? Evidently not. What does this say
>> which -all create_region
Are you sure it's there and that you've spelled it correctly, and that the name inside create_region.m on the "function" line matches the name of the m-file: create_region?
What is gvar? Is that your m-file? If not, where did gvar come from? Can you attach gvar so we can look at line 568 and see this call to create_region() in context?
댓글 수: 13
economics student
2020년 5월 2일
>> which -all create_region
'create_region' not found.
economics student
2020년 5월 2일
attached is the gvar.m
economics student
2020년 5월 2일
starting in 554
for r=1:length(rnamesx)
if annual == 0
misal = not(strcmp(lastobs,max_date));
else
misal = not(isequal(lastobs,max_date));
end
if forc_flag == 1 && misal == 1
% aggregating actual data not used for estimation, for comparing it with GVAR
% forecasts
rdv = create_region(rnamesx(r), regionsx.(rnamesx{r}),rnobs, vnum, vnames, rdv, aggrwgts);
end
[dv aggrwgts] = create_region(rnamesx(r), regionsx.(rnamesx{r}),nobs, vnum, vnames, dv, aggrwgts);
end
Image Analyst
2020년 5월 2일
The authors contact info is included in gvar.m. Contact him and ask for the missing file.
economics student
2020년 5월 3일
What missing file? G-var is not the m-file for this function?
Image Analyst
2020년 5월 3일
The file called "create_region.m"
attached is the file. the GVar zip contains a folder with 107 other functions.
economics student
2020년 5월 3일
Does this mean that maybe the programme will get stuck with the remaining other functions and that maybe access to this code folder should be granted?
economics student
2020년 5월 3일
and how can this issue be fixed for this particular function? the naming of the function is correct and function definition seems good aswell.
Image Analyst
2020년 5월 3일
If other functions are also missing, then, of course, they will also generate similar error messages.
I told you the way to fix it was to obtain that function, most likely from the author of that toolbox you used.
Why do you say "function definition seems good aswell"? I did not see that function anywhere in gvar.m. Where did you see it's definition? I just see it called, not defined.
economics student
2020년 5월 3일
The m folder for this function is attached in previous email. The definition is in that create_region.m file
Image Analyst
2020년 5월 3일
Well then it's not on the search path. Just put it in the same folder as gvar or your main m-file so it can be found.
economics student
2020년 5월 3일
Many thanks.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Adding custom doc에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
