⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f_caliper.asv

📁 DSP程序 Matlab是一套用于科学工程计算的可视化高性能语言与软件环境。它集数值分析、矩阵运算、信号处理和图形显示于一体
💻 ASV
字号:
function [x,y] = f_caliper(k,disp)

%F_CALIPER: Measure coorinates on current plot using mouse
%
% Usage: [x,y] = f_caliper(k,disp)
%
% Inputs: 
%         k    = number of points measured.  
%         disp = an optional display code.  If disp ~= 0, then
%               the measured coordinates are displayed. 
% Outputs: x = k by 1 array containing x coordinates of points
%          y = k by 1 array containing y coordinates of points

% Initialize

k = f_clip (k,1,k);
if nargin < 2
   disp = 0;
end
x = zeros(k,1);
y = zeros(k,1);
close_msg = ['warndlg(''You must use the mouse crosshairs to select points on the plot before '''...
             '''closing the figure window'',''Usage of f_caliper.'')'];
set (gcf,'CloseRequestFcn',close_msg)

% Measure points

hold on
for i = 1 : k
     [x(i),y(i)] = ginput(1);
     plot (x(i),y(i),'k+')
     if disp
         s = sprintf ('  (x,y) = (%.2f,%.2f)',x(i),y(i));
         text (x(i),y(i),s)
     end
end
hold off
set (gcf,'CloseRequestFcn','delete(gcf)')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -