From: Michael Coughlin on 28 May 2010 17:39 Hi, I have a text file with three columns of numbers in it, where the rows are ordered by the size of the number in the second column. The first column corresponds to gps time, and I would like to pull out the 5 gps times in the list which have the highest second number but also are more than 400 seconds apart. My current code is below. For some reason, the code does not quite do what I want (I am still ending up with times within 400 seconds of one another), can someone help me out? Thank you, Michael [gps sig freq] = textread([channel_name '.txt'],'%f %f %f','commentstyle','sh ell'); gps_keep=[gps(1)]; for j=2:length(gps) if (length(gps_keep)<5) gps_pm=[gps_keep-400 gps_keep+400]; stop=0; for k=1:length(gps_pm(:,1)) if (stop==0) if (gps(j)<gps_pm(k,1) || gps_pm(k,2)<gps(j)) gps_keep=[gps_keep gps(j)]; stop=1; end end end end end
|
Pages: 1 Prev: plot object hit area? Next: extracting single structure from isosurface |