MATLAB: Convert to MATLAB Code

convertMATLABmatlab function

Best Answer

Hi,
Following code illustrates the implementation of the above equation:
x=[2 3]; %x vector
f=function_5(x);
function f= function_5(x)
a=ones(2,25); % a(i,j)
sum1=0;
sum=0;
for j=1:25
for i=1:2
sum1= sum1 + (x(i) - a(i,j))^6;
end
sum = sum + 1/(j+sum1);
suom1=0;
end
f=0.002+sum;
end
Hope it helps!!
Related Question