Mercurial > repos > public > sbplib
comparison subsSymfun.m @ 820:501750fbbfdb
Merge with feature/grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 07 Sep 2018 14:40:58 +0200 |
parents | 489bea7fc33f |
children |
comparison
equal
deleted
inserted
replaced
819:fdf0ef9150f4 | 820:501750fbbfdb |
---|---|
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 |