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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!