1 |
|
2 |
%- convert binary input file from native ieee to (ieee) big-endian: |
3 |
fName='float_pos.input'; |
4 |
|
5 |
imax=9; |
6 |
[fid,errMsg]=fopen(fName,'r','n'); |
7 |
if ~isempty(errMsg), |
8 |
fprintf(['ERROR in "rdsqbin" : try to open file=',fnam,'\n']); |
9 |
fprintf(['==> ',errMsg]); fprintf('\n\n'); |
10 |
return |
11 |
end |
12 |
|
13 |
r1=fread(fid,imax,'real*8'); |
14 |
np=r1(1); |
15 |
|
16 |
fprintf('read %i reccords ...',np); |
17 |
rA=fread(fid,imax*np,'real*8'); |
18 |
fprintf(' OK\n'); |
19 |
fclose(fid); |
20 |
rA=reshape(rA,[imax np]); |
21 |
|
22 |
var=zeros(imax,np+1); |
23 |
var(:,1)=r1; |
24 |
var(:,2:np+1)=rA; |
25 |
|
26 |
namfil='float_pos.inp_b'; |
27 |
fid=fopen(namfil,'w','b'); fwrite(fid,var,'real*8'); fclose(fid); |
28 |
|
29 |
|