source: altifloat/matlab_toolbox/arrange_fwd.m @ 129

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

last version of Varanth

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