やあ、
下のスクリーンショットに示すデータ系列があり、「y」の最大値を中心に「x +/- 0.3」の範囲のデータのみを選択しようとしています。
以下に示すように、強調表示された行から「SelectWhere の引数が true または false に評価されませんでした。[0]...」というエラー メッセージが表示されました。 不可解なのは、1 つの条件のみが適用されたときに最後の行が機能したことです。
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);
最大の行が複数ある場合は、次のことができます
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 ) ),
);

2 番目のピークの選択されていないポイントは、浮動エラーのためです。
したがって、問題を回避するには、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);
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);
やあ、
次の構文を使用してみてください。
dt << select where (eval (mxx - 0.3) <= :x < eval (mxx + 0.3));
一番、
TS