フィルターのクリア

help in coding for station data

1 回表示 (過去 30 日間)
Seemant Tiwari
Seemant Tiwari 2021 年 8 月 12 日
回答済み: Image Analyst 2021 年 8 月 12 日
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 件のコメント
the cyclist
the cyclist 2021 年 8 月 12 日
編集済み: the cyclist 2021 年 8 月 12 日
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.

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

採用された回答

Image Analyst
Image Analyst 2021 年 8 月 12 日

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by