Undefined function or variable

3 ビュー (過去 30 日間)
economics student
economics student 2020 年 5 月 2 日
コメント済み: economics student 2020 年 5 月 3 日
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
Image Analyst 2020 年 5 月 2 日
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 件のコメント
Image Analyst
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
economics student 2020 年 5 月 3 日
Many thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAdding custom doc についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by