Interpolate multiple data for a plot
Mostra commenti meno recenti
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 Commenti
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
il 17 Ott 2018
Madlab
il 17 Ott 2018
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Cell Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!