showresults.m
来自「基于声源的方向定位程序」· M 代码 · 共 37 行
M
37 行
function sigma = showResults(xopt, m1, m2, act, calc, err, m, c)%SHOWRESULTS Display results of the localization algorithm.%% sigma = showResults(xopt, m1, m2, act, calc, err, m, c)% Plot the best point. Also print the coords of the best point% and per-delay information.global scale scaleTextcheckScale('init')hold onplot(xopt(1), xopt(2), 'o', 'LineWidth', 3)hold offdisp(' ')disp(sprintf('Best location: [x y] = [%.3f %.3f]', xopt(1), xopt(2)))disp(' ')disp(sprintf(' phone1 phone2 Actual Calculated Error%s', scaleText))disp([m1' m2' act calc err*scale])n = length(m1);sigma = sqrt(m/(n-2))*1000/c;disp(sprintf('Mean error is %g ms',sigma))% Generate mesh plot of error surface%figure(2)%clf%contour(x(:,1),y(1,:),log(e'),12)%title('Log of error function')%figure(3)%clf%meshc(x(:,1),y(1,:),log(e'))%title('Log of error function')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?