CIAO,
Ho una serie di dati mostrata nello screenshot qui sotto e provo a selezionare solo i dati nell'intervallo "x +/- 0,3" con il centro al valore massimo di "y".
Ho ricevuto un messaggio di errore "L'argomento di SelectWhere non è stato valutato come vero o falso, è [0]..." dalla riga evidenziata, come mostrato di seguito. Ciò che lascia perplessi è che l'ultima riga ha funzionato quando è stata applicata solo 1 condizione.
Cosa c'è di sbagliato nello script nella riga 6? Grazie!

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);
Se ci sono più righe che sono al massimo, potresti farlo
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 ) ),
);

Il punto non selezionato sul secondo picco è dovuto a un errore di fluttuazione.
Quindi, per aggirare il tuo problema, basta indicizzare il primo valore del tuo 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);
Penso che a JMP non piaccia che tu stia confrontando matrici con numeri singoli.
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);
CIAO,
Prova ad utilizzare la seguente sintassi:
dt << select where (eval (mxx - 0.3) <= :x < eval (mxx + 0.3));
Migliore,
ST