Run assignment command based on if else in command browser

Hello all,
This is a simple assignment operation to the column of an existing wave 'BA' based on a condition,

 if ( BA  [p][0] >1e4) ;
    BA [][1] =  sqrt ( BA [p][0] + 0.08 * BA [p][0] );
 else  
    BA [][1] = sqrt ( BA [p][0] + 0.01 * BA [p][0] )  ;  
 endif   ;

Above can be very easily executed using a defined function. I wonder if this can be  run directly in the command browser.

I tried the linearized version of the above, as a one-liner,  in the command browser but I receive error "Expected wavename, variable or operation".


Any suggestions.

 

BA[][1] = (BA[p][0] > 1e4) ? sqrt(BA[p][0] + 0.08 * BA[p][0]) : sqrt(BA[p][0] + 0.01 * BA[p][0])

I haven't tested this, but this is the format of the type of expression you need.

Thanks. It works as expected.

The format seems :   

 assignment = (condition) ? yes (do this) : no (do this)

 

Yes, you can read more about this under the section for the 'conditional operator' in the following chapter:

DisplayHelpTopic "Operators"