第1个回答 2014-01-25
g = subs(f,old,new) replaces all occurrences of old with new in f, and then evaluates f.
g = subs(f,new) replaces all occurrences of the default variable in f (defined by symvar) with new , and then evaluates f.
g = subs(f) replaces symbolic variables in f with their values obtained from the calling function and the MATLAB workspace, and then evaluates f. Variables with no assigned values remain as variables.
g = subs(f,old,new,0) prevents switching the arguments old and new if subs(f,old,new) returns f. Without this additional argument, the toolbox also tries subs(f,new,old) if subs(f,old,new) returns f. This approach provides backwards compatibility with previous versions and eliminates the need to remember the order of the arguments.