Interpolate multiple data for a plot
Mostrar comentarios más antiguos
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 comentarios
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
el 17 de Oct. de 2018
Madlab
el 17 de Oct. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!