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!