필터 지우기
필터 지우기

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