Filter löschen
Filter löschen

help in coding for station data

1 Ansicht (letzte 30 Tage)
Seemant Tiwari
Seemant Tiwari am 12 Aug. 2021
Beantwortet: Image Analyst am 12 Aug. 2021
yea = 0;
for ye = 2009:2017
yea = yea+1;
data{yea} = load(['D:\DataStation\hr', num2str(ye),'\mat\station.mat']);
data{yea} = data{1,yea}.station_1(:,:);
end
i write above programme and get matrix 8760x9 double this for station 1
i have 30 station and i want matrix 8760x270 double
i am writing code data{yea} = [data{1,yea}.station_1(:,:); data{1,yea}.station_2(:,:);] i think this not correct method
please help
  1 Kommentar
the cyclist
the cyclist am 12 Aug. 2021
Bearbeitet: the cyclist am 12 Aug. 2021
It might be helpful for you to upload two or three of the station.mat files here, so people can test code. (You could just trim them to a few rows, if you don't want to upload all the data.)
Is there are specific reason you are using cell arrays to store the data? If it is all numeric data, that might not be the best approach.
Also, have you considered making the data 8760x9x30, where the stations are the 3rd dimension?
Finally, I would be remiss if I did not mention that dynamic naming of variables (e.g. station_1, station_2, etc) is generally a terrible coding practice. See, e.g. this explanation of why. It would be good if we can figure out a way to not do that.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 12 Aug. 2021

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by