MATLAB: How to simplify a algebra function matlab function Hi guys, Could anyone help me on simplify this function? I wanna remove the brackets. f(x)=(x^2 + 1)^3 Thank you Best Answer Hi,syms f(x)fun = f(x) == (x^2 + 1)^3fun = collect(fun,x)results in:fun =f(x) == (x^2 + 1)^3fun =f(x) == x^6 + 3*x^4 + 3*x^2 + 1 Related SolutionsMATLAB: FMINUNC cannot continue. You have to save your function myfun in separate file myfun.mfunction [ f ] = myfun( x )f = 3*x(1)^2 + 2*x(1)*x(2) + x(2)^2; % Cost functionendAnd then execute commands:x0 = [1,1];[x,fval] = fminunc(@myfun,x0)Or simpler (in one line without additional file):[x,fval] = fminunc(@(x)3*x(1)^2 + 2*x(1)*x(2) + x(2)^2,[1 1]);See also:http://www.mathworks.com/help/toolbox/optim/ug/brhkghv-3.html MATLAB: Cant simplify an algebraic equation It seems to slimplify nicely for me:syms A B C x g(x) = (A*(x + 1)^3 + C*(x + 1)^3 + B*(x - 1)*(x + 1)^2)/((x - 1)*(x + 1)^3);g = simplify(g, 'Steps', 20)g(x) =A/(x - 1) + B/(x + 1) + C/(x - 1)Do you want something different? Related QuestionFailure in initial objective function evaluation. FMINUNC cannot continue.Simplification of an algebraic equationHow to write x as a function of f(x)How can i fix this error ? Failure in initial user-supplied objective function evaluation. FMINUNC cannot continue.Fmincon optimization with nonlinear constraintStrange behaviour of simplify
Best Answer