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

📄 makshape.mht

📁 it is a very essential matlab code.
💻 MHT
字号:
From: <Saved by Windows Internet Explorer 7>
Subject: 
Date: Tue, 12 May 2009 09:59:12 -0700
MIME-Version: 1.0
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: http://www.mece.ualberta.ca/Courses/mec390/390code/makshape.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY><PRE>function D = makshape
% Allows user to create a 2D shape using picks in the graphics
% window.  The shape is stored in array D where the 1st column
% is vector of x-coordinates, 2nd column is vector of y-coordinates
%
% USAGE:  D = makshape
%
% to make the shape:
%     LEFT MOUSE BUTTON   - pick a point
%     RIGHT MOUSE BUTTON  - end shape creation

clf
fx = [-10 10 10 -10 -10];
fy = [-10 -10 10 10 -10];
plot(fx,fy)                   % draws a 10 X 10 frame
axis('equal')

hold on

i = 0;
b = 1;

while b &lt; 2     % read picks until right button
   [tx, ty, b] = ginput(1);  % read single pick point and button
   if b == 1      % left button -&gt; store point coordinates and plot
      i = i+1;
      x(i) = tx; y(i) = ty;
      plot(tx,ty,'b+')
   end
end


D(:,1) = x';
D(:,2) = y';

x(i+1) = x(1);
y(i+1) = y(1);
plot(x,y)

</PRE></BODY></HTML>

⌨️ 快捷键说明

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