%%% Section 1.2 %%% Noisy Depth Sensors clear close all % Az = Y A = 1; z = -3; sigma = 0.02; %%% estimate z 1000 times A = ones(4,1); zm = z+sigma*randn(4,1000); zest = inv(A'*A)*A'*zm; vest = std(zest) v1 = std(zm(1,:)) [n,x] = hist(zest,40); [n2,x2] = hist(zm(1,:),40); figure(1) bar(x2,n2,'hist') hold on; h=bar(x,n,'hist'); hold off set(h,'facecolor','y') legend('Single Measurement','LLSE') text(-3.06, 70, ['STD = 0.02 meters']) text(-3.06, 60, ['LLSE = ',num2str(round(10000*std(zest))/10000),'meters'])