Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- normalize[file_] :=
- Module[{mtfile = OpenRead[file, BinaryFormat -> True], data, Mat},
- SetStreamPosition[mtfile, 0];
- data = Partition[BinaryReadList[mtfile, "Real32", ByteOrdering -> 1],1297];
- Close[mtfile];
- Mat = Join[data[[All, ;; 45]], Transpose[Standardize /@ Transpose[data[[All, 46 ;; 47]]]], data[[All, 48 ;;]], 2];
- BinaryWrite[file, Flatten@Mat, "Real32", ByteOrdering -> 1];];
- FileByteCount["00010005.dat"]/2^10.
- (*891.688*)
- normalize["00010005.dat"];
- FileByteCount["00010005.dat"]/2^10.
- (*8025.19*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement