comparison matlabFunctionSizePreserving.m @ 886:8894e9c49e40 feature/timesteppers

Merge with default for latest changes
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 15 Nov 2018 16:36:21 -0800
parents 489bea7fc33f
children
comparison
equal deleted inserted replaced
816:b5e5b195da1e 886:8894e9c49e40
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