MATLAB: Derivative of a Function derivative function Is there a way to input a function as "g=@(x) exp(x^2-2);" and take the derivative? Best Answer If you have the Symbolic Toolbox:>> g = @(x) exp(x^2-2)g = @(x)exp(x^2-2)>> syms x>> diff(g(x))ans =2*x*exp(x^2 - 2) Related SolutionsMATLAB: Format coefficients of the derivative of a function Convert everthing to symbolic to prevent the loss of precisionsyms xe = exp(sym(1));f = x * e^x^2; format shortdf = diff(f)Result>> dfdf =exp(2*x) + 2*x*exp(2*x) MATLAB: Heaviside and sign function The heavside function is not the same as the sign function, you can't simply change one for another. If you want to write the sign function in terms of a heavside function you can use the following relation:Where is the heavside function. Related QuestionSecond Derivative using diffNumeric Derivative – problem entering dfDiff function (second derivative)
Best Answer