Is there Matlab code that generates random closed form expressions as strings in a notation that is compatible with str2func?
Given a cell of functions and terminals and a maximal string length this is the initialization task of genetic programming but with str2func compatible strings instead of tree representation.
If not directly perhaps indirectly where the string output is further transformed.
For example initialization methods in genetic programming like ‘full’ or ‘grow’ [1] generate expressions in prefix notation that can not be processed by str2func, so an additional transformation is needed.
[1] Poli, Riccardo; Langdon, William B.; McPhee, Nicholas Freitag: A Field Guide to Genetic Programming. 2008, p14