1 | clear all |
---|
2 | clc |
---|
3 | |
---|
4 | outfile='obs_float/oneandfive_final.dat'; |
---|
5 | load obs_float/oneandfive.dat; |
---|
6 | [m,n]=size(oneandfive) |
---|
7 | |
---|
8 | |
---|
9 | count=1; |
---|
10 | for s=1:m/6 |
---|
11 | oneandfive(s,2)=count; |
---|
12 | oneandfive(s+m/6,2)=count; |
---|
13 | oneandfive(s+2*m/6,2)=count; |
---|
14 | oneandfive(s+3*m/6,2)=count; |
---|
15 | oneandfive(s+4*m/6,2)=count; |
---|
16 | oneandfive(s+5*m/6,2)=count; |
---|
17 | |
---|
18 | |
---|
19 | count=count+3; |
---|
20 | |
---|
21 | |
---|
22 | end |
---|
23 | |
---|
24 | fid=fopen(outfile,'w'); |
---|
25 | fprintf(fid,'%d %d %d %f\n',oneandfive(:,1:4)'); |
---|
26 | |
---|
27 | |
---|
28 | |
---|
29 | outfile='obs_float/final_oneandfive.dat'; |
---|
30 | load obs_float/oneandfive_final.dat; |
---|
31 | [d,f]=size(oneandfive_final) |
---|
32 | floater1=zeros(d,f); |
---|
33 | count1=1; |
---|
34 | |
---|
35 | |
---|
36 | for i=1:d/2 |
---|
37 | floater(count1,:)=oneandfive_final(i,:); |
---|
38 | floater(count1+1,:)=oneandfive_final(i+d/2,:); |
---|
39 | |
---|
40 | |
---|
41 | count1=count1+2; |
---|
42 | |
---|
43 | end |
---|
44 | |
---|
45 | |
---|
46 | fid=fopen(outfile,'w'); |
---|
47 | fprintf(fid,'%d %d %d %f\n',floater'); |
---|
48 | fclose(fid); |
---|
49 | |
---|
50 | outfile='obs_float/obs_oneandfive.dat'; |
---|
51 | load obs_float/final_oneandfive.dat; |
---|
52 | [d,f]=size(final_oneandfive); |
---|
53 | counter=1; |
---|
54 | I=find(final_oneandfive(:,3)==1); |
---|
55 | final_oneandfive(I,3)=4; |
---|
56 | I=find(final_oneandfive(:,3)==2); |
---|
57 | final_oneandfive(I,3)=1; |
---|
58 | I=find(final_oneandfive(:,3)==3); |
---|
59 | final_oneandfive(I,3)=2; |
---|
60 | fid=fopen(outfile,'w'); |
---|
61 | fprintf(fid,'%d %d %d %f\n',final_oneandfive'); |
---|
62 | fclose(fid); |
---|