function J = sumsq_vonBert(p,tdata,ldata)
% Function computing sum of square errors for von Bertalanffy model
model = p(1)*(1 - exp(-p(2)*tdata));
error = model - ldata;
J = error*error';
end

%[p1,J,flag] = fminsearch(@sumsq_vonBert,[100,0.1],[],tdfish,ldfish)