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

📄 cfield.m

📁 hi i have a huge collection are you interested
💻 M
字号:
%cfield(x,y,z,mx,Mx,my,My,c1,c2,S)%%   Draws a "circle-field" at the points  (x(i),y(i)) %     specified by the vectors  x  and  y.%   At each point, an  "x"  of color  c1  and a circle of %     color  c2  and size proportional to z(i) is drawn.%   If  c1  is specified,  c2  must also be specified.%     Default colors are cyan and yellow.%%   mx, Mx, my, My  %     are optional arguments specifying the range to be used for %     the axes (defaults used are  min(x), max(x), min(y), max(y)%     +/- a tenth of the range).%%   S is an optional number that scales the length of the arrows.%     Default is 1.% kwong@mcs.anl.gov  11/14/93function cfield(x,y,z,mx,Mx,my,My,c1,c2,S)% PARSE THE ARGUMENT LISTif nargin <= 4 | nargin == 7 | nargin == 8, c1 = 'c'; c2 = 'y'; endif nargin == 4, S = mx(1);elseif nargin == 5, c1 = mx; c2 = Mx;elseif nargin == 6, c1 = mx; c2 = Mx; S = my;endif ~exist('S'), S = 1; endif nargin < 7  mx = min(min(x)); Mx = max(max(x)); Dx = (Mx-mx)/10;  mx = mx-Dx;  Mx = Mx+Dx;  my = min(min(y)); My = max(max(y)); Dy = (My-my)/10;  my = my-Dy;  My = My+Dy;ends = S*min(Mx-mx,My-my)/12;                      % DEFINE THE t = 0:0.1:2*pi; cx = s*cos(t); cy = s*sin(t);   % UNIT CIRCLEx = x(:); y = y(:); z = z(:)/max(max(z));  % CHANGE TO VECTORSplot(x,y,[ c1 'x' ]);                      % PLOT x POINTShold onfor i = 1:length(x)                        % PLOT CIRCLES  plot(x(i)+z(i)*cx,y(i)+z(i)*cy,c2);endaxis([mx Mx my My]), hold off              % TURN OFF HOLD

⌨️ 快捷键说明

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