summaryrefslogtreecommitdiff
path: root/964/CH15/EX15.7/15_7.sce
blob: 025fdea24d6cea1f77c6410b97bcd1d4ebb9d351 (plain)
1
2
3
4
5
6
7
8
9
clc;
clear;
function y=fx(x)
    y=-(2*sin(x)-x^2/10)
endfunction
x=fminsearch(fx,0)
disp("After maximization:")
disp(x,"x=")
disp(fx(x),"f(x)=")