안녕,
아래 스크린샷과 같은 데이터 계열이 있고 중심이 "y"의 최대값인 "x +/- 0.3" 범위의 데이터만 선택하려고 합니다.
아래와 같이 강조 표시된 줄에서 "SelectWhere에 대한 인수가 true 또는 false로 평가되지 않았습니다. [0]...입니다."라는 오류 메시지가 나타납니다. 문제는 마지막 줄이 하나의 조건만 적용되었을 때 작동했다는 것입니다.
6행의 스크립트에 대한 설명으로 옳지 않은 것은? 감사!

Names Default To Here( 1 );
dt = current data table();
mxrow = dt << get rows where (:y == col max(:y) );
mxx = dt:x[mxrow];
print (mxrow, mxx);
dt << select where (:x < mxx + 0.3 & :x > mxx - 0.3);
dt << select where (:x < mxx + 0.3);
안녕,
다음 구문을 사용해 보세요.
dt << select where (eval (mxx - 0.3) <= :x < eval (mxx + 0.3));
최고,
TS
JMP는 행렬을 단일 숫자와 비교하는 것을 좋아하지 않는다고 생각합니다.
Names Default To Here(1);
dt = New Table("Untitled", Add Rows(3), New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3])));
max_x = [2];
dt << Select Where(:Column 1 > max_x); // will print message to log
wait(2);
min_x = 2;
dt << Select Where(:Column 1 < min_x);
따라서 문제를 해결하려면 mxx의 첫 번째 값을 색인화하십시오.
Names Default To Here( 1 );
dt = current data table();
mxrow = dt << get rows where (:y == col max(:y) );
mxx = (dt:x[mxrow])[1]; //Index into the matrix and extract the first item
print (mxrow, mxx);
dt << select where (:x < mxx + 0.3 & :x > mxx - 0.3);
dt << select where (:x < mxx + 0.3);
최대에 여러 행이있는 경우 할 수 있습니다.
Names default to here(1);
dt = New Table( "Test",
Add Rows( 46 ),
New Column( "x",
Set Values(
[1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.1, 2.2, 2.3, 2.4,
2.5, 2.6, 2.7, 2.8, 2.9, 3, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9,
4, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5, 5.1, 5.2, 5.3, 5.4,
5.5]
)
),
New Column( "y",
Set Values(
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
1]
)
)
);
mxrow = dt << get rows where (:y == col max(:y) );
mxx = dt:x[mxrow];
dt << select where (Any(mxx - 0.3 <= :x < mxx + 0.3));
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :x ), Y( :y ) ),
);

두 번째 피크에서 선택되지 않은 점은 부동 오류 때문입니다.