source: altifloat/matlab_toolbox/arrange_new.m @ 160

Last change on this file since 160 was 129, checked in by jbrlod, 10 years ago

last version of Varanth

File size: 830 bytes
Line 
1function [ output_args ] = arrange_new(  )
2
3
4
5outfile='../obs_float/forwardedbymean.dat';
6load ../obs_float/r_float_obs.dat;
7[d,f]=size(r_float_obs)
8floater1=zeros(d,f);
9
10
11fid = fopen('../obs_float/r_float_obs.dat', 'rb');
12fseek(fid, 0, 'eof');
13fileSize = ftell(fid);
14frewind(fid);
15data = fread(fid, fileSize, 'uint8');
16numLines = sum(data == 10) + 1;
17fclose(fid);
18m=numLines-1;
19count1=1;
20for i=1:m
21    if r_float_obs(i,3)==1
22        floater(count1,:)=r_float_obs(i,:);
23        count1=count1+1;
24    end
25end
26
27for i=1:m
28    if r_float_obs(i,3)==2
29        floater(count1,:)=r_float_obs(i,:);
30        count1=count1+1;
31    end
32end
33for i=1:m
34    if r_float_obs(i,3)==3
35        floater(count1,:)=r_float_obs(i,:);
36        count1=count1+1;
37    end
38end
39
40
41
42fid=fopen(outfile,'w');
43fprintf(fid,'%d %d %d %f\n',floater');
44fclose(fid);
45
46
47end
48
Note: See TracBrowser for help on using the repository browser.