MATLAB: How to convert symbolic function into non symbolic function.

guisymbolic

Hi. I am trying to make a GUI algorithm and just realize that syms (from the symbolic toolbox) is not working for the compiler.
Is there any way I can use another command or change function into non-symbolic function?
My function has the following form.
syms A E B
diff_A = diff(exp(-(pre/(exp(A)*exp(E./(k*(273.16+normal_stress)))))^B),A);
A=x(1)

Best Answer

Use the matlabFunction function:
syms A E B pre k normal_stress
diff_A = diff(exp(-(pre/(exp(A)*exp(E./(k*(273.16+normal_stress)))))^B),A);
diff_A_fcn = matlabFunction(diff_A)
to get:
diff_A_fcn =
function_handle with value:
@(A,B,E,k,normal_stress,pre)B.*pre.*exp(-E./(k.*(normal_stress+2.7316e2))).*exp(-A).*exp(-(pre.*exp(-E./(k.*(normal_stress+2.7316e2))).*exp(-A)).^B).*(pre.*exp(-E./(k.*(normal_stress+2.7316e2))).*exp(-A)).^(B-1.0)
Related Question