Interpolating data at different heights for various times in Matlab -
i have set of data (144 rows , 7 columns). first column time , remaining 6 temperature @ heights 1,2,4,8,16 , 32 m. interpolate (linearly) between heights i.e. h = 1:0.5:32. , make contour plot.. please guide me regarding this, doing first time in matlab.. appreciated.. shital
you linear interpolation per row (see interp1 @ matlab):
for lp = 1:size(data,1) datai(lp,:) = interp1([1 2 4 8 16 32],data(lp,2:end),h,'linear'); end
for contour plot;
figure(1); contour(data(:,1), h, transpose(datai)) xlabel('time') ylabel('temperature') legend('height')
Comments
Post a Comment