New functionality in r7947:
- Added option variableFilter to translate/buildModel/simulate
commands/simulation runtime
- This argument is a regular expression; any variable that matches
this expression is present in the result file
- The default value is ".*", which matches _any_ variable
- The regex provided is treated as: ^(%regex%)$, i.e. you are forced
to write regular expressions that match the complete name (no substring
matches)
What does this mean? Well, you can now specify a simulate command like this:
simulate(MyClass,variableFilter="r\\[[1-2]*\\]|r\\[.\\]");
// Output indices of variable r that only contain the numbers 1 or 2
// or where the index is a single digit, i.e. matches r[1221] or r[8]
The regular expression implementation uses POSIX extended regular
expression syntax. See for example:
http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions
I hope someone finds this useful.
--
Martin Sjölund