MATLAB: What functions are valid for optimization expressions

MATLABoptimizationoptimproblemoptimvar

I get an error where an optimization expression can't evaluate a logical NOT (~). I also tried using functions such as "all()" and "unique()" which also caused errors. Looking at the reference here:
https://www.mathworks.com/help/optim/ug/optim.problemdef.optimizationexpression.html
It appears that optimization expressions can only use very basic arithmatic functions like "sum()" or transposing matrices. What types of functions can be used in optimization expressions outside of these?

Best Answer

I'm sorry that you couldn't find this information in the documentation. Supported Operations o Optimization Variables and Expressions
This link, of course, is to the latest software version. Check out the version for your software version if it is not current.
Alan Weiss
MATLAB mathematical toolbox documentation