이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?예를 들어, 그림의 첫 번째 행에 있는 04-07 바이트를 부동 소수점 숫자로 변환하십시오. 전문가에게 감사드립니다!

올바른 결과는 1006.27입니다.
바이너리 파일은 다음과 같습니다.
598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000
스크립팅창回复:怎样将二进制文件中的指定字节转化为浮点数字?excel VBA

답변: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?이 기능은 구현할 수 없습니다
CopyMemory v, b(0), 4
재: 怎样将二进制文件中的指定字节转化为浮点数字?
filename = Save Text File(
"$temp/deleteme.bin",
Hex To Blob( "598A0F0548917B44F6C87B44855B7B44D7637B44DA57BE45140B000000000000" )
);
// load the entire file. You could use the blob() parameter
// to load a smaller part of the file by offset and length.
blobdata = Load Text File( filename, blob() );
// convert the binary data to a matrix. The 4 means 4 byte chunks
// and "little" means the least significant byte comes first (little endian.)
numbers = Blob To Matrix( blobdata, "float", 4, "little" );
// print the values; JMP uses 8-byte floating point and will
// display more resolution than is actually available.
For( i = 1, i <= N Rows( numbers ), i += 1,
Write( "\!n", i, " ", numbers[i] )
);
1 6.74923813801151e-36
2 1006.27001953125
3 1007.14001464844
4 1005.42999267578
5 1005.55999755859
6 6090.9814453125
7 3.97408244482518e-42
8 0
다른 방향을 변환하는 유사한 기능인 Matrix To Blob이 있습니다.
4바이트 부동 소수점은 6 또는 7개의 유효 자릿수를 갖습니다. 8바이트 부동 소수점은 15개 또는 16개의 유효 자릿수를 갖습니다.
https://en.wikipedia.org/wiki/Single-precision_floating-point_format
https://en.wikipedia.org/wiki/Double-precision_floating-point_format
편리한 비트 표시 기능이 있는 Windows 16진수 계산기를 사용하려면 바이트를 반대로 해야 합니다.
48917B44 -> 447B9148 -> 0 10001000 11110111001000101001000 -> 2^(136-127) * (1+1/2+1/4+1/8+1/16+0/32)
Re: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?감사합니다 전문가!
이 바이너리 파일에서
00, 01바이트-년, 월, 일
02, 03 바이트-시분할

코드에서 세분화를 늘리시겠습니까? 다시 한 번 감사합니다!
numbers = Blob To Matrix( blobdata, "float", 4, "little" );
재: 怎样将二进制文件中的指定字节转化为浮点数字?이 4바이트를 4개의 1바이트 단위 또는 2개의 2바이트 단위로 처리할 수 있습니다. Uint는 부호 없는 정수를 의미합니다. float 대신 uint를 사용하십시오. 그것들이 시간을 어떻게 나타내는지 알아내야 할 것입니다. 디코딩되지 않은 한 가지 예만으로는 명확하지 않습니다.
Re: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?나는 여전히 이 작업을 수행할 수 있는 능력이 있습니다.
전체 파일을 업로드했는데 이와 같은 데이터 행이 5070개 있습니다.
인코딩 방법을 참조하세요?
감사 해요!
00 to 01 bytes: indicates the date. If the value is num, the date calculation method is as follows:
year=floor(num/2048)+2004;
month=floor(mod(num,2048)/100);
day=mod(mod(num,2048),100);
02 to 03 bytes: indicates the number of minutes from 0 o 'clock to the present
04 to 07 bytes: float
08 to 11 bytes: float
12 to 15 bytes: float
16 to 19 bytes: float
20 to 23 bytes: float
24 to 27 bytes: integer
28 to 31 bytes :(reserved)
재: 怎样将二进制文件中的指定字节转化为浮点数字?이런 식으로 데이터 그래프를 만들 수 있습니다. 이상치가 있는 것 같습니다!
data extracted from the zip file and graphed to see outliers.zip 파일에서 추출한 데이터를 그래프로 표시하여 이상값을 확인합니다.
/*
00 to 01 bytes: indicates the date. If the value is num, the date calculation method is as follows:
year=floor(num/2048)+2004;
month=floor(mod(num,2048)/100);
day=mod(mod(num,2048),100);
02 to 03 bytes: indicates the number of minutes from 0 o 'clock to the present
04 to 07 bytes: float
08 to 11 bytes: float
12 to 15 bytes: float
16 to 19 bytes: float
20 to 23 bytes: float
24 to 27 bytes: integer
28 to 31 bytes :(reserved)
*/
za = Open( "z:/445.zip", "zip" ); // open the zip file
datasetname = (za << dir)[1];
blobdata = za << read( datasetname, Format( blob ) ); // load the member as a blob
//
// the following 3 lines import ALL of the data each time. Later,
// only use the columns that were really in that format.
//
integer2 = Blob To Matrix( blobdata, "uint", 2, "little", 16 ); // get the 2-byte unsigned ints for columns 0-1 and 2-3
integer4 = Blob To Matrix( blobdata, "uint", 4, "little", 8 ); // get the 4-byte unsigned ints for columns 24-27 and 28-31
float4 = Blob To Matrix( blobdata, "float", 4, "little", 8 ); // get the 4-byte floats for columns 4-23
// pre-process the matrix columns; no explicit loop is required...
years = Floor( integer2[0, 1] / 2048 ) + 2004;
months = Floor( Mod( integer2[0, 1], 2048 ) / 100 );
days = Mod( Mod( integer2[0, 1], 2048 ), 100 );
seconds = 60 * integer2[0, 2];
// create a table. You could also use new table, but the v1...v5 would be a little more code to type
dt = As Table(
years,
months,
days,
seconds,
float4[0, 2 :: 6],
integer4[0, 7 :: 8],
<<COLUMNNAMES></COLUMNNAMES>
Re: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?전문가님들의 많은 도움 부탁드립니다!
JMP는 너무 강력합니다!
JMP는 이렇게 사용할 수 있습니다!
너무 적게 알고 있습니다.
전문가들에게 다시 한 번 감사드립니다!
Re: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?나는 여전히 전문가들에게 계속 물어야 한다.
이 파일에서 이와 같은 데이터의 마지막 480줄만 추출한 경우 코드를 수정하는 방법은 무엇입니까?
감사합니다 전문가!
이러한 데이터는 원본 파일의 5070줄입니다. 그리고 원본 바이너리 파일의 끝은 데이터가 아닌 다른 텍스트입니다.
Re: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?이렇게 수정을 시도했지만 실패했습니다.
r = N Row( years );
dt = As Table(
years,
months,
days,
seconds,
float4[r - 479 :: r, 2 :: 6], ////
integer4[r - 479 :: r, 7 :: 8], ///
<<COLUMNNAMES></COLUMNNAMES>
재: 怎样将二进制文件中的指定字节转化为浮点数字?로그에 메시지가 있었나요?
이러한 모든 배열(년, 월, 일, 초)은 동일한 처리가 필요합니다(예: 년[r-479::r]).
테이블을 생성한 후 테이블에서 원하지 않는 행을 삭제하는 것이 더 쉬울 수 있습니다. 날짜 열을 사용하여 원하는 범위를 선택하십시오.
Re: 이진 파일의 지정된 바이트를 부동 소수점 숫자로 변환하는 방법은 무엇입니까?이 그래픽을 보고 나는 두 가지 의문을 제기합니다.
1. 그래픽이 연속적이고 날짜 간격에 영향을 받지 않게 하려면 이를 달성하는 간단한 방법이 있습니까? 행 번호 열만 X축으로 사용합니다.
Column( "reserved" ) << Formula( Row() );dt << run formulas;Column( "reserved" ) << deleteFormula;
……
Variables( X( :reserved ), Y( :v5 ), Y( :v4 ), Y( :v3 ), Y( :v2 ), Y( :v1 ), Y( :xx ) ),

2. 실제로 이 데이터 스톡의 거래 데이터.
JMP에서 이런 일본 촛대를 직접 만들 수 있습니까? 이런 종류의 그래프는 엑셀에서 쉽게 생성할 수 있습니다.

매우 감사합니다!