Mercurial > repos > public > sbplib
comparison subsSymfun.m @ 609:8cbecf22075b feature/utux2D
Merge to get interpolation operators.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Sat, 14 Oct 2017 22:36:31 -0700 |
parents | 489bea7fc33f |
children |
comparison
equal
deleted
inserted
replaced
605:0f9d20dbb7ce | 609:8cbecf22075b |
---|---|
1 % Subs for a symfun | |
2 % f remains a symbolic function. If any of it's arguments is eliminated | |
3 % it is removed from the argument list while preserving the order of the | |
4 % other arguments | |
5 function f = subsSymfun(f, old, new) | |
6 args = argnames(f); | |
7 | |
8 newExpr = subs(f, old, new); | |
9 vars = symvar(subs(args, old, new)); | |
10 | |
11 newArgs = args(ismember(args,vars)); | |
12 | |
13 f = symfun(newExpr, newArgs); | |
14 end |