function [coeffdrag] = DragInterpolations_ICANSAT(velocity, altitude, time, tb) % global tb drag_data = dlmread("ICANSAT/ICANSAT_DragData.txt", "\t",1,0); % Mach No mach_no = drag_data(:,1); % Full base drag cd_full = drag_data(:,3); % No base drag cd_zero = drag_data(:,2); [temp, sound_speed, P, rho] = atmosisa(altitude); mach_speed = velocity/sound_speed; if (time > tb) coeffdrag = interp1(mach_no, cd_full, mach_speed); else coeffdrag = interp1(mach_no, cd_zero, mach_speed); end end