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

📄 slplotbot.html

📁 Robot tool box - provides many functions that are useful in robotics including such things as kinem
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"                "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head>  <title>Description of slplotbot</title>  <meta name="keywords" content="slplotbot">  <meta name="description" content="SLPLOTBOT	S-function for robot animation">  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">  <meta name="robots" content="index, follow">  <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> &gt;  <a href="#">simulink</a> &gt; slplotbot.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td><td align="right"><a href="index.html">Index for ./simulink&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>slplotbot</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>SLPLOTBOT	S-function for robot animation</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function [sys,x0,str,ts] = splotbot(t,x,u,flag, robot) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment">SLPLOTBOT    S-function for robot animation This is the S-function for animating the robot.  It assumes input data u to be the joint angles q. Implemented as an S-function so as to update display at the end of each Simulink major integration step.</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></ul><!-- crossreference --><h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><ul style="list-style-image:url(../matlabicon.gif)"><li><a href="#_sub1" class="code">function [sys,x0,str,ts]=mdlInitializeSizes</a></li></ul><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <span class="comment">%SLPLOTBOT    S-function for robot animation</span>0002 <span class="comment">%</span>0003 <span class="comment">% This is the S-function for animating the robot.  It assumes input</span>0004 <span class="comment">% data u to be the joint angles q.</span>0005 <span class="comment">%</span>0006 <span class="comment">% Implemented as an S-function so as to update display at the end of</span>0007 <span class="comment">% each Simulink major integration step.</span>0008 0009 <a name="_sub0" href="#_subfunctions" class="code">function [sys,x0,str,ts] = splotbot(t,x,u,flag, robot)</a>0010     <span class="keyword">switch</span> flag,0011 0012     <span class="keyword">case</span> 00013         <span class="comment">% initialize the robot graphics</span>0014         [sys,x0,str,ts] = <a href="#_sub1" class="code" title="subfunction [sys,x0,str,ts]=mdlInitializeSizes">mdlInitializeSizes</a>;    <span class="comment">% Init</span>0015         plot(robot, zeros(1, robot.n))0016 0017     <span class="keyword">case</span> 20018         <span class="comment">% come here on update</span>0019         <span class="keyword">if</span> ~isempty(u),0020             plot(robot, u');0021             drawnow0022         <span class="keyword">end</span>0023         ret = [];0024     <span class="keyword">case</span> {1, 4, 9}0025         ret = [];0026     <span class="keyword">end</span>0027 <span class="comment">%</span>0028 <span class="comment">%=============================================================================</span>0029 <span class="comment">% mdlInitializeSizes</span>0030 <span class="comment">% Return the sizes, initial conditions, and sample times for the S-function.</span>0031 <span class="comment">%=============================================================================</span>0032 <span class="comment">%</span>0033 <a name="_sub1" href="#_subfunctions" class="code">function [sys,x0,str,ts]=mdlInitializeSizes</a>0034  0035 <span class="comment">%</span>0036 <span class="comment">% call simsizes for a sizes structure, fill it in and convert it to a</span>0037 <span class="comment">% sizes array.</span>0038 <span class="comment">%</span>0039 <span class="comment">% Note that in this example, the values are hard coded.  This is not a</span>0040 <span class="comment">% recommended practice as the characteristics of the block are typically</span>0041 <span class="comment">% defined by the S-function parameters.</span>0042 <span class="comment">%</span>0043 sizes = simsizes;0044  0045 sizes.NumContStates  = 0;0046 sizes.NumDiscStates  = 0;0047 sizes.NumOutputs     = 0;0048 sizes.NumInputs      = -1;0049 sizes.DirFeedthrough = 1;0050 sizes.NumSampleTimes = 1;   <span class="comment">% at least one sample time is needed</span>0051  0052 sys = simsizes(sizes);0053  0054 <span class="comment">%</span>0055 <span class="comment">% initialize the initial conditions</span>0056 <span class="comment">%</span>0057 x0  = [];0058  0059 <span class="comment">%</span>0060 <span class="comment">% str is always an empty matrix</span>0061 <span class="comment">%</span>0062 str = [];0063  0064 <span class="comment">%</span>0065 <span class="comment">% initialize the array of sample times</span>0066 <span class="comment">%</span>0067 ts  = [0 0];0068  0069 <span class="comment">% end mdlInitializeSizes</span></pre></div><hr><address>Generated on Sun 15-Feb-2009 18:09:29 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address></body></html>

⌨️ 快捷键说明

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