Next: Increment and decrement operators, Previous: Coherent syntax, Up: Octave Features [Contents][Index]
The exclamation mark ‘!’ (aka “Bang!”) is a negation operator, just like the tilde ‘~’:
octave:1> if ! strcmp (program_name, "octave"), > "It's an error" > else > "It works!" > end ans = It works!
Note however that MATLAB uses the ‘!’ operator for shell
escapes, for which Octave requires using the system
command.