MATLAB: Importing countries and years data into MATLAB

data importgraphimporting excel dataplot

I am new to the whole matlab environment so i was hoping someone is able to guide me along. The project i am doing is environment related, i have data of various countries as well as the energy consumption, forest area and carbon emission. They are labeled as (E1990, F1990, C1990).
I have the following code to sort them in various years making it easier to call them out when plotting various graphs. However i am thinking of sorting them by countries.
Energy = FullDataset(1:60,:);
D1990 = Energy(:, { 'Country' 'E1990' 'C1990' 'F1990' 'P1990'});
D1991 = Energy(:, { 'Country' 'E1991' 'C1991' 'F1991' 'P1991'});
D1992 = Energy(:, { 'Country' 'E1992' 'C1992' 'F1992' 'P1992'});
D1993 = Energy(:, { 'Country' 'E1993' 'C1993' 'F1993' 'P1993'});
Example: Plot (Australia E1990, Canada E1990) or Plot (Australia , Canada) // this is suppose to show data ranging from E1990 – E1997 for Australia against Canada.
Secondly, I am seeking recommendation for the type of graph i should be using. Given that my data set consist of Energy consumption, forest area, carbon emission, population, earth average temperature.
Would really appreciate any comments or help given.
Cheers

Best Answer

Attach the data file. This can probably be done very easily with the new "table" data type.
% Example using patients demo table.
load patients
patients = table(Age,Gender,Height,Weight,Smoker,...
'RowNames',LastName)
t = patients([2,4], [1, 3,4])
xData = t{1,:}
yData = t{2,:}
scatter(xData, yData);
Requires R2013b or later.
Related Question