How to plot seasonal cycle

5 views (last 30 days)
Daphne PARLIARI
Daphne PARLIARI on 24 Jan 2020
Hello!
I have several .txt files that contain daily measurements of temperature and relative humidity (see attached file).
I want to plot 4 seasonal graphs, both for T and RH, for all my files.
So far what I've done is that I access all these files. But how do I continue? Thanks in advance! (I'm on Matlab 2019a)
% Variables
vars={'Temperature'; 'Relative humidity'};
years = {'2015'; '2019'};
varunits={'Celsius'; '%' };
%Starting loop for all files
for i=1:size(stations,1)
name = stations( i, 1 );
network = stations (i, 'Network');
lat = stations(i, 'Lat' );
lon = stations(i, 'Lon' );
%% Here we make the selection based on network and station
network.(1);
name.(1);
networkstr = char(network.(1));
namestr = char(name.(1));
indx = strfind (list1, namestr) ;
for j = 1:size(indx, 1)
if (indx{j,1}>0)
if (strfind (list1{j,1}, '2015') > 0)
if (strfind (list1{j,1}, 'Hourly') > 0)
if (strfind(list1{j,1}, 'txt') > 0)
disp(list1{j,1})
B = importdata(list1{j,1}, ',', 1);
Data = B.data;
Data = array2table(Data);
end
end
end
end
end
end

Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!