% function ss = landauss(params,data) udata = data.ydata; P = data.xdata; alpha_1 = params(1); alpha_11 = params(2); alpha_111 = params(3); uvals_data = alpha_1*P.^2 + alpha_11*P.^4 + alpha_111*P.^6; res = udata - uvals_data; ss = res'*res;