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

📄 needleplotst.m

📁 hopfield neural network for binary image recognition
💻 M
字号:
% NEEDLEPLOTST - needleplot of 3D surface from slant tilt data
%
% Usage:  needleplotst(slant, tilt, len, spacing)
%
%        slant, tilt - 2D arrays of slant and tilt values
%        len         - length of needle to be plotted
%        spacing     - sub-sampling interval to be used in the
%                      slant and tilt data. (Plotting every point
%                      is typically not feasible)

% Peter Kovesi  
% School of Computer Science & Software Engineering
% The University of Western Australia
% pk @ csse uwa edu au
% http://www.csse.uwa.edu.au/~pk
%
% July 2003

function needleplotst(slant, tilt, len, spacing)

    lw = 1;  % linewidth
  if ~all(size(slant) == size(tilt))
    error('slant matrix must have same dimensions as tilt');
  end

  % Subsample the slant and tilt matrices according to the specified spacing
  s_slant = slant(1:spacing:end, 1:spacing:end);
  s_tilt = tilt(1:spacing:end, 1:spacing:end);

  [s_rows, s_cols] = size(s_slant);

  projlen = len*sin(s_slant);   % projected length of each needle onto xy plane
  dx = projlen.*cos(s_tilt);
  dy = projlen.*sin(s_tilt);

  clf
  for r = 1:s_rows
    for c = 1:s_cols
      x = (c-1)*spacing+1;
      y = (r-1)*spacing+1;
      plot(x,y,'b.'); hold on
      line([x x+dx(r,c)],[y y+dy(r,c)],'color',[0 0 1],'linewidth',lw);
    end
  end
  axis('equal')
  hold('off')

⌨️ 快捷键说明

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