Question: How do I combine these two codes using varargin? first code: function [ output ] = CritPt(f, var1, var2) f = evalin(symengine,f); % Calculate Partials
How do I combine these two codes using varargin?
first code:
function [ output ] = CritPt(f, var1, var2)
f = evalin(symengine,f);
% Calculate Partials
fx=diff(f,var1);
fy=diff(f,var2);
% Solve for critical point
[xcr,ycr]=solve(fx,fy);
output = [xcr,ycr];
end
second code:
function [ out ] = CritPt1(f,var1)
f = evalin(symengine,f);
x = var1;
fx = diff(f,x);
xcr = solve(fx);
out = xcr;
end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
