How to plot gridded data
조회 수: 11 (최근 30일)
이전 댓글 표시
please help, I used the retime function to change my gridded temperature data from daily to yearly. I tried plotting the data using pcolor but got the error (color data input must be a matrix) How can I plot this data?
댓글 수: 6
Walter Roberson
2021년 6월 29일
Your dt from above is 1 element longer than 16435. datetime('1-jan-2015')-datetime(1970,1,1) is 16436 days. You lost a day somewhere ??
채택된 답변
Walter Roberson
2021년 6월 29일
dt=(datetime(1970,01,01) :datetime(2014,12,31))';
temp_data = randi(9, 16436,900);
T = timetable (dt,temp_data);
yearlytemp = retime(T, 'yearly', 'sum');
yt = yearlytemp{:,1};
p = pcolor(1:size(yt,2), yearlytemp.dt, yt); p.EdgeColor = 'none';
댓글 수: 8
Walter Roberson
2021년 7월 3일
BW = poly2mask(x, y, size(yearlytemp,1), size(yearlytemp,2))
maskedyearly = yearlytemp{:,1};
maskedyearly(BW) = nan;
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
