Interpolate multiple data for a plot
이전 댓글 표시
I am having trouble interpolating data. I don't quite know what variables to insert into interp1. I need to plot sea against temperature after interpolating as the time for sea and time for weather is different. Any tips?
for k=1:7
figure
w{k} = interp1(timeweather{k},avgtemp{k},sealevel{k},'linear');
plot(timeweather{k},avgtemp{k},'-',5,w{k},'*')
plot(timeweather{k},avgtemp{k},'r')
hold on
plot(timesea{k},sealevel{k},'c')
end
댓글 수: 3
Tip: use a timetable and synchronize.
Can you tell us what the 7 cells of the cell array describe? Are they different locations or something? Also, what format is the time in, is it in fractional years?
num2str(timesea{1})
ans =
912×9 char array
'1935.0416'
' 1935.125'
'1935.2084'
Madlab
2018년 10월 17일
Madlab
2018년 10월 17일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!