% x = [ 1 3 0 2 0 2 0 1 5 ] olarak tanımlanmalıdır.

x=[1 5 0 2 0 1 1 9 8]
sum(x*x')
sum(x.^2)
D=length(x)
x1=x(1)
x2=x(2)

% -200e^{-0\ldotp 02} \sqrt{{\mathrm{x1}}^2 +{\mathrm{x2}}^2 }
% exp(1) exp(x)=e^x
% ans = 2.7183


-200*exp(-0.02*sqrt(x1^2+x2^2))

%                                         -20\ast e^{-0\ldotp 02} \sqrt{D^{-1} \sum_{i=1}^D {x_i }^2 }-e^{D-1\sum_{i=1}^D \mathrm{cos}\left(2\pi \mathrm{xi}\right)} +20+e

-20*exp(-0.02*sqrt(D^-1*sum(x.^2)))-exp(D^-1*sum(cos(2*pi*x)))+20+exp(1)

% \sum_{i=1}^{D} \left|x_i \ast \mathrm{sin}\left(x_i \right)+0\ldotp 1\ast x_i \right|

sum(abs(x.*sin(x)+0.1*x))

% \prod_{i=1}^{D} \mathrm{sin}\left(x_i \right)\ast \sqrt{x_i }

prod(sqrt(x).*sin(x))

% \sum_{i=1}^{D} \frac{{x_i }^2 }{4000}-\prod_{i=1} \cos \left(\frac{x_i }{\sqrt{i}}\right)+1

toplam=sum((x.^2./4000))
carpim=prod(cos((x./sqrt(1:D))))
toplam-carpim+1

% \sum_{i=1}^{D} \left(e^{-0\ldotp 2} \ast \sqrt{{x_i }^2 +{x_{i+1} }^2 }+3\ast \left(\mathrm{cos}\left(2\ast x_i \right)+\mathrm{sin}\left(2\ast x_{i+1} \right)\right)\right)

%sum(exp(-0.2)*sqrt(x.^2+x))
%xi+1?

%                                 \sum_{i=1}^D i\ast {x_i }^2+\sum_{i=1}^D 20\ast i\ast {\mathrm{sin}}^2 A+\sum_{i=1}^D i\ast {\mathrm{log}}_{10} \left(1+i\ast B^2 \right)

%syms i
%toplam1=symsum(i*(x(i))^2,1,D)

sum([1:D].*x.^2)


A=(x(i-1)*sin(x(i))+sin(x(i+1)))
B=((x(i-1))^2-2*x(i)+3*x(i+1)-cos(x(i))+1)
toplam1=0;
for i=1:D
    toplam=i*x(i)^2;
    toplam1=toplam1+toplam
end
toplam2=0;

for i=1:D
    toplam2=20*i*(sin(A))^2;
    toplam2=toplam2+0;
end

toplam3=0;
for i=1:D
   toplam3= i*log(1+i*B^2);
   toplam3=toplam3+0;
end
sonuc=toplam1+toplam2+toplam3;
sonuc