constructing identifiers for a large panel data

1 回表示 (過去 30 日間)
ektor
ektor 2017 年 3 月 30 日
編集済み: Image Analyst 2017 年 3 月 30 日

Dear all,

I have a panel data of 180 countries covering the period 2000-2010.

Here is a sample:

 list={'Australia' 
    'Cameroon'
    'Canada'
    'Colombia'
    'Costa Rica'
    'Denmark'
    'Dominican Republic'
    'Ecuador'
    'Egypt'
    'Fin' 
    'Israel'
    'Italy'
    'Japan'
    'Kenya'
    'Korea South'
    'Madagascar'
    'Malawi'
    'Malaysia'
    'Mexico'
    'Morocco'
    'Netherlands'
    'New Zealand'
    'Norway'
    'Peru'
    'Philippines'
    'Portugal'
    'Senegal'
    'Singapore'
    'South Africa'};

I want to construct identifiers, that is Austalia to take the value of 1 over the period 2000-2010, Camerron the value of 2, etc.,. Is there a code for doing quickly (with few lines of code)?

Many thanks

回答 (1 件)

Image Analyst
Image Analyst 2017 年 3 月 30 日
編集済み: Image Analyst 2017 年 3 月 30 日
Well you could just do
numberedList = 1 : length(list);
or you could look into the function called categorical() in the Stats toolbox. Or the function ismember() in base MATLAB. Not exactly sure what your intent is so I can't provide a definitive answer.

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by