Mercurial > repos > public > sbplib
comparison matlabFunctionSizePreserving.m @ 599:489bea7fc33f feature/grids
Add some functions to make symbolic life easier
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 26 Sep 2017 15:38:25 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
598:f6ada1719420 | 599:489bea7fc33f |
---|---|
1 % Takes a symfun and makes a better anonymous function | |
2 function fun = matlabFunctionSizePreserving(f) | |
3 mf = matlabFunction(f); | |
4 args = argnames(f); | |
5 | |
6 funStr = func2str(mf); | |
7 for i = 1:length(args) | |
8 funStr = [funStr sprintf(' + 0*%s', toString(args(i)))]; | |
9 end | |
10 | |
11 fun = str2func(funStr); | |
12 end |