First I run the following script.
x1 = 15600; y1 = 7540; z1 = 20140;
x2 = 18760; y2 = 2750; z2 = 18610;
x3 = 17610; y3 = 14630; z3 = 13480;
x4 = 19170; y4 = 610; z4 = 18390;
t1 = 0.07074; t2 = 0.07220; t3 = 0.07690; t4 = 0.07242;
c = 299792458;
x0 = [1 1 1 1];
Now my function to find x,y,z, and d.
function F = myfun325_1(x,y,z,d)
F = [sqrt(((x – x(1)).^2) + ((y – y(1)).^2) + ((z – z(1)).^2)) – c*(t(1) – d); sqrt(((x – x(2)).^2) + ((y – y(2)).^2) + ((z – z(2)).^2)) – c*(t(2) – d); sqrt(((x – x(3)).^2) + ((y – y(3)).^2) + ((z – z(3)).^2)) – c*(t(3) – d); sqrt(((x – x(4)).^2) + ((y – y(4)).^2) + ((z – z(4)).^2)) – c*(t(4) – d);];
end
I run the code: fsolve(@myfun325_1,x0) and am returned the following error:
Error using myfun325_1 (line 3) Not enough input arguments.
Error in fsolve (line 241) fuser = feval(funfcn{3},x,varargin{:});
Caused by: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
Best Answer