<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4916583487472719772</id><updated>2011-07-30T09:09:40.427-07:00</updated><title type='text'>MAtlab &amp; Maxima</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-6092768984658285226</id><published>2009-10-20T19:22:00.000-07:00</published><updated>2009-10-20T19:47:09.293-07:00</updated><title type='text'>Runge Kutta 现象</title><content type='html'>多项式插值一般在2-5次为宜，最多不超过6，7次。也就是说，在节点数很多的时候，最好将它们分组，分段，对每段则分别用低次多项式插值，这样效果比较接近真实。片面的追求高次多项式，将不会得到好结果。&lt;br /&gt;&lt;br /&gt;一个著名的例子是Runge给的，他是Weierstruss在Berlin的学生，也是F. Klein在Gottingen的同事。&lt;br /&gt;用于模拟常微分方程的解的重要的一类迭代法，龙格－库塔法（Runge-Kutta）是由他和Kutta共同发明的。月球上的Runge陨石坑 (Runge crater) 以他命名。&lt;br /&gt;&lt;br /&gt;f(x)=1/(1+25*x^2)&lt;br /&gt;在[-1，1]内取n+1（在这里取n=10）个等距节点，做n次牛顿插值的结果如下，&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bon1sB2lVF8/St50xS1NLSI/AAAAAAAAAQo/IcuGYrnesjQ/s1600-h/Runge_Kutta.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 334px;" src="http://3.bp.blogspot.com/_bon1sB2lVF8/St50xS1NLSI/AAAAAAAAAQo/IcuGYrnesjQ/s400/Runge_Kutta.jpg" alt="" id="BLOGGER_PHOTO_ID_5394877793853844770" border="0" /&gt;&lt;/a&gt;其中红线为插值结果，黑线为被插值的函数，可以看出，在[-.2，.2]区间内，插值结果很好，但随着区域的扩大，出现了很大的偏差，特别是在-1，1两点附近，插值多项式基本不能描述被插函数。&lt;br /&gt;这就是Runge-Kutta现象。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;源代码如下，&lt;br /&gt;=========demo_RungeKutta.m:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;x_node =-1:.2:1;&lt;br /&gt;y_node = 1./(1+25.*x_node.*x_node);&lt;br /&gt;a = mynewtonCoeff(x_node,y_node);&lt;br /&gt;x=-1:.01:1;&lt;br /&gt;y = mynewtonPoly(a,x_node,x);&lt;br /&gt;plot(x_node,y_node,'*b',x,y,'r',x,y1,'k');&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;===========mynewtonCoeff.m:&lt;br /&gt;&lt;br /&gt;function a = mynewtonCoeff(xData,yData)&lt;br /&gt;% Returns coefficients of Newton's polynomial.&lt;br /&gt;% USAGE: a = newtonCoeff(xData,yData)&lt;br /&gt;% xData = x-coordinates of data points.&lt;br /&gt;% yData = y-coordinates of data points.&lt;br /&gt;&lt;br /&gt;n = length(xData);&lt;br /&gt;a = yData;&lt;br /&gt;for k = 2:n&lt;br /&gt;    a(k:n) = (a(k:n) - a(k-1))./(xData(k:n) - xData(k-1));&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;=========mynewtonPoly.m&lt;br /&gt;&lt;br /&gt;function p = mynewtonPoly(a,xData,x)&lt;br /&gt;% evaluate the value of Newton's polynomial at x.&lt;br /&gt;% USAGE: p = newtonPoly(a,xData,x)&lt;br /&gt;% a     = coefficient array of the polynomial;&lt;br /&gt;%         must be computed first by newtonCoeff.&lt;br /&gt;% xData = x-coordinates of data points.&lt;br /&gt;&lt;br /&gt;n = length(xData);&lt;br /&gt;&lt;br /&gt;p = a(n)*ones(size(x));&lt;br /&gt;for k = 1:n-1;&lt;br /&gt;    p = a(n-k) + (x - xData(n-k)).*p;&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-6092768984658285226?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/6092768984658285226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=6092768984658285226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/6092768984658285226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/6092768984658285226'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/10/runge-kutta.html' title='Runge Kutta 现象'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bon1sB2lVF8/St50xS1NLSI/AAAAAAAAAQo/IcuGYrnesjQ/s72-c/Runge_Kutta.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-5912917327026831310</id><published>2009-10-11T20:45:00.000-07:00</published><updated>2009-10-11T21:07:00.666-07:00</updated><title type='text'>Ax=b直接法</title><content type='html'>Why?&lt;br /&gt;Ax=b是数值分析的基础，没有几个算法里面不需要解线性方程组的。&lt;br /&gt;&lt;br /&gt;Linear, algebraic equations occur in almost all branches of numerical analysis. But their most visible application in engineering is in the analysis of linear systems (any&lt;br /&gt;system whose response is proportional to the input is deemed to be linear). Linear systems include structures, elastic solids, heat flow, seepage of fluids, electromagnetic fields and electric circuits; i.e.,most topics taught in an engineering curriculum.&lt;br /&gt;&lt;br /&gt;If the system is discrete, such as a truss（&lt;span style="color: rgb(1, 1, 1);font-family:標楷體;font-size:100%;"  &gt;&lt;b style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 102);"&gt;桁架&lt;/b&gt;（truss）是以剛性直桿為材料，在桿件之兩端以平滑之&lt;b&gt;銷釘結合&lt;/b&gt;（pin  joint）而成之剛性構架。在工程上運用甚廣，且具實用性及經濟性。&lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;桁架&lt;/b&gt;之桿件稱為&lt;b&gt;構件（member）&lt;/b&gt;，接合點亦稱為節點。實際上&lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;桁架&lt;/b&gt;之節點是用焊接而成，但為簡化設計，各直桿端部均假設以光滑銷釘連接，故各直桿均以二力桿件處理。&lt;/span&gt;） or an electric circuit, then its analysis leads directly to linear algebraic equations. In the case of a statically determinate truss, for example, the equations arise when the equilibrium conditions of the joints are written down. The unknowns x1, x2, . . . , xn represent the forces in the members and the support reactions, and the constants b1, b2, . . . , bn are the prescribed external&lt;br /&gt;loads.&lt;br /&gt;&lt;br /&gt;The behavior of continuous systems is described by differential equations, rather than algebraic equations. However, because numerical analysis can deal only with discrete variables, it is first necessary to approximate a differential equation with a&lt;br /&gt;system of algebraic equations. The well-known &lt;span style="color: rgb(255, 0, 0);"&gt;finite difference, finite element and boundary element methods&lt;/span&gt; of analysis work in this manner. They use different approximations to achieve the “discretization,”but in each case the final task is the same:&lt;br /&gt;solve a system(often a very large system) of linear, algebraic equations.&lt;br /&gt;&lt;br /&gt;In summary, the modeling of linear systems invariably gives rise to equations of the form Ax = b, where b is the input and x represents the response of the system.&lt;br /&gt;&lt;br /&gt;The coefficient matrix A, which reflects the characteristics of the system, is independent of the input. In other words, if the input is changed, the equations have to be solved again with a different b, but the same A. Therefore, it is desirable to have&lt;br /&gt;an equation-solving algorithm that can handle any number of constant vectors with minimal computational effort.&lt;br /&gt;&lt;br /&gt;解Ax=b的法子大概可分为两类，&lt;br /&gt;1 直接法&lt;br /&gt;2 迭代法&lt;br /&gt;&lt;br /&gt;Overview of Direct Methods&lt;br /&gt;&lt;br /&gt;Table 2.1 lists three popular direct methods, each of which uses elementary operations to produce its own final form of easy-to-solve equations.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;Method                              Initial form                Final form&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Gauss elimination                 Ax = b                       Ux = c&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;LU decomposition                 Ax = b                      LUx = b&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Gauss–Jordan elimination   Ax = b                     Ix = c&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;LU法的优点是，对于某一个特定的A，当b变动时，仅需要forward substitution 和 back substitution就可以得到解。&lt;br /&gt;&lt;br /&gt;function A = LUdec(A)&lt;br /&gt;%Dolittle's decomposition&lt;br /&gt;%returns A=[L\U]&lt;br /&gt;%USAGE: A = LUdec(A)&lt;br /&gt;&lt;br /&gt;n = size(A,1);&lt;br /&gt;for i =1:n-1   &lt;br /&gt;    for j =i+1:n&lt;br /&gt;        if(A(j,i))&lt;br /&gt;            l = A(j,i)/A(i,i);&lt;br /&gt;            A(j,i+1:n)= A(j,i+1:n)- l*A(i,i+1:n);&lt;br /&gt;            A(j,i)= l;&lt;br /&gt;        end&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;function x = LUsol(A,b)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;% first call LUdec to decompose A=L*U&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;% then, Solves L*U*b = x by first forward substitution&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;% and finally back substitution&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;% USAGE: x = LUsol(A,b)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;A = LUdec(A);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;n=size(A,1);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;for i = 2:n&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    b(i,:)= b(i,:) - A(i,1:i-1)*b(1:i-1,:);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;for k = n:-1:1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    b(k,:) = (b(k,:) - A(k,k+1:n)*b(k+1:n,:))/A(k,k);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;x=b;&lt;br /&gt;&lt;br /&gt;上面两个函数实现了LU分解和用LU的结果解方程。注意这里的代码可以解决Ax=b，当b不止一列的情形。&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-5912917327026831310?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/5912917327026831310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=5912917327026831310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/5912917327026831310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/5912917327026831310'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/10/axb.html' title='Ax=b直接法'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-7871239549578572461</id><published>2009-10-11T15:14:00.000-07:00</published><updated>2009-10-11T15:22:04.289-07:00</updated><title type='text'>实现最简单的Gaussian Elimination</title><content type='html'>不考虑任何特殊情况，最简单的高斯消去法可实现如下，&lt;br /&gt;&lt;br /&gt;% the most simple Gauss Elimination&lt;br /&gt;&lt;br /&gt;function b = Gauss_Elim(A,b)&lt;br /&gt;&lt;br /&gt;n = length(b);&lt;br /&gt;&lt;br /&gt;%Elimination phase&lt;br /&gt;for i =1:n-1   &lt;br /&gt;    for j =i+1:n&lt;br /&gt;        if(A(j,i))&lt;br /&gt;            l = A(j,i)/A(i,i);&lt;br /&gt;            A(j,i:n)= A(j,i:n)- l*A(i,i:n);&lt;br /&gt;            b(j) = b(j)-l*b(i);&lt;br /&gt;        end&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;%back substitution&lt;br /&gt;b(n)= b(n)/A(n,n);&lt;br /&gt;for i = (n-1):-1:1&lt;br /&gt;    b(i)=b(i)-A(i,i+1:n)*b(i+1:n);&lt;br /&gt;    b(i)=b(i)/A(i,i);&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;试比较下面的代码，&lt;br /&gt;&lt;br /&gt;function b = g(A,b)&lt;br /&gt;n = length(b);&lt;br /&gt;%-----------------Elimination phase-------------&lt;br /&gt;for k = 1:n-1&lt;br /&gt;    for i = k+1:n&lt;br /&gt;        if A(i,k) ~= 0&lt;br /&gt;            lambda = A(i,k)/A(k,k);&lt;br /&gt;            A(i,k+1:n) = A(i,k+1:n) - lambda*A(k,k+1:n);&lt;br /&gt;            b(i)= b(i) - lambda*b(k);&lt;br /&gt;        end&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;size(A)&lt;br /&gt;&lt;br /&gt;%--------------Back substitution phase-----------&lt;br /&gt;for k = n:-1:1&lt;br /&gt;    k&lt;br /&gt;    b(k) = (b(k) - A(k,k+1:n)*b(k+1:n))/A(k,k)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;这两段代码的区别，&lt;br /&gt;1 在消去阶段，区别在于对主对角线元素下元素的处理。前者作了处理，后者未作处理。&lt;br /&gt;2在回代阶段，后者代码中当k=n时，A(k,k+1:n)相当于A(n,n+1:n)，在matlab中实际上是一个Empty matrix: 1-by-0，&lt;br /&gt;但是当A(k,k+1:n)*b(k+1:n)，结果会是0。这可能是matlab内部的一个设计，使得代码变得简洁。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-7871239549578572461?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/7871239549578572461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=7871239549578572461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/7871239549578572461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/7871239549578572461'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/10/gaussian-elimination.html' title='实现最简单的Gaussian Elimination'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-3314392625424235110</id><published>2009-10-03T16:31:00.000-07:00</published><updated>2009-10-03T17:58:58.715-07:00</updated><title type='text'>sin(1/x)的内里乾坤</title><content type='html'>在学习微积分的时候，大多数教程都会给出 y=sin(1/x)，作为不连续函数的例子。这个函数的草图很容易画，大多数教程上也会有这么一个图，&lt;br /&gt;x=-1:.0011:1;&lt;br /&gt;y = sin(1./x);&lt;br /&gt;plot(x,y,'-b');&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_bon1sB2lVF8/SsfvpAUw9aI/AAAAAAAAAO8/ymG9L8XlYpY/s1600-h/cont.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_bon1sB2lVF8/SsfvpAUw9aI/AAAAAAAAAO8/ymG9L8XlYpY/s400/cont.jpg" alt="" id="BLOGGER_PHOTO_ID_5388538966912857506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;从这图上看不出什么模式出来，然而，如果用散点图，&lt;br /&gt;x=-1:.0011:1;&lt;br /&gt;y = sin(1./x);&lt;br /&gt;plot(x,y,'.r');&lt;br /&gt;则如下图，&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_bon1sB2lVF8/Ssfhc_7BJuI/AAAAAAAAANs/y7bskeKZXyQ/s1600-h/sin1overx.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 310px;" src="http://2.bp.blogspot.com/_bon1sB2lVF8/Ssfhc_7BJuI/AAAAAAAAANs/y7bskeKZXyQ/s400/sin1overx.jpg" alt="" id="BLOGGER_PHOTO_ID_5388523367483647714" border="0" /&gt;&lt;/a&gt;在散点图中似乎存在着某种规律和模式。&lt;br /&gt;&lt;br /&gt;我们继续用下面的代码来仔细看看，&lt;br /&gt;&lt;br /&gt;% this program show some interesting patterns hidden in the "randomness" of&lt;br /&gt;% sin(1/x) near zero.&lt;br /&gt;&lt;br /&gt;n=1:4000;&lt;br /&gt;x = 1./n; % range of x is [.00025 1];&lt;br /&gt;y = sin(n);&lt;br /&gt;plot(x,y,'.b');&lt;br /&gt;legend('x=1/n y=sin(n) n=1:4000','Location','NorthOutside');&lt;br /&gt;legend boxoff;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_bon1sB2lVF8/SsfwpdqSSOI/AAAAAAAAAPE/c5DOIO2fSd0/s1600-h/bare.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_bon1sB2lVF8/SsfwpdqSSOI/AAAAAAAAAPE/c5DOIO2fSd0/s400/bare.jpg" alt="" id="BLOGGER_PHOTO_ID_5388540074299377890" border="0" /&gt;&lt;/a&gt;这个图显然不太合理，因为大多数点都被压缩到很窄小的区域，而居中广阔的区域却只有少数几个点享用。因此，我们需要调整x轴的分辨率和定义范围。&lt;br /&gt;&lt;br /&gt;如何调整？&lt;br /&gt;我们可以用histgram函数来看看数据定义域的直方图，由此可以大概知道数据的分布情况。&lt;br /&gt;用简单命令，&lt;br /&gt;N =hist(x)&lt;br /&gt;&lt;br /&gt;N =&lt;br /&gt;&lt;br /&gt;3991           5           1           1           1           0           0           0           0           1&lt;br /&gt;&lt;br /&gt;可以看出，x在[0,0.1]这个区间内，有3991个点！&lt;br /&gt;而在[0.1,1.0]这个区间内只有9个点！&lt;br /&gt;可见分布的极其不均匀。&lt;br /&gt;&lt;br /&gt;因此，为了让“镜头”对准“大多数”，我们需要调整“镜头”的取向和焦距了。&lt;br /&gt;这可以由命令&lt;br /&gt;axis([xmin  xmax ymin ymax]);&lt;br /&gt;来调节。&lt;br /&gt;&lt;br /&gt;我们先试着用&lt;br /&gt;axis([0.0 .1 -1 1]);&lt;br /&gt;得到的结果是这样的，&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bon1sB2lVF8/SsftLiGb1NI/AAAAAAAAAN0/Vk0bncjgFEc/s1600-h/.1plot.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_bon1sB2lVF8/SsftLiGb1NI/AAAAAAAAAN0/Vk0bncjgFEc/s400/.1plot.jpg" alt="" id="BLOGGER_PHOTO_ID_5388536261560227026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;说明镜头对准的是少数的“权贵阶级”，仍未对准“沉默的大多数”，&lt;br /&gt;实际上，用&lt;br /&gt;xx= x(find(x&lt;.1));hist(xx) 可以看出，在此区间内，分布极其不均匀，  此时的直方图如下，     &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_bon1sB2lVF8/Ssfth9WQ11I/AAAAAAAAAN8/ozBQUpkEQ70/s1600-h/.1hist.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_bon1sB2lVF8/Ssfth9WQ11I/AAAAAAAAAN8/ozBQUpkEQ70/s400/.1hist.jpg" alt="" id="BLOGGER_PHOTO_ID_5388536646831494994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;继续尝试，xx= x(find(x&lt;.01));hist(xx) 发现此时分布有些好了，起码能看出点梯度来。  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_bon1sB2lVF8/SsfuDcSjBlI/AAAAAAAAAOE/HHyiKaFJqWk/s1600-h/.01hist.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_bon1sB2lVF8/SsfuDcSjBlI/AAAAAAAAAOE/HHyiKaFJqWk/s400/.01hist.jpg" alt="" id="BLOGGER_PHOTO_ID_5388537222073091666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;此时的散点图如下，已能看出一些模式，但是大多数点仍偏居一隅！&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_bon1sB2lVF8/SsfuR20LGpI/AAAAAAAAAOM/aU9RVWd-mKE/s1600-h/.01plot.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_bon1sB2lVF8/SsfuR20LGpI/AAAAAAAAAOM/aU9RVWd-mKE/s400/.01plot.jpg" alt="" id="BLOGGER_PHOTO_ID_5388537469711620754" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;再继续尝试，xx= x(find(x&lt;.003));hist(xx)，  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bon1sB2lVF8/Ssfuo1hCaII/AAAAAAAAAOc/8RDTPX01C5Y/s1600-h/.003hist.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_bon1sB2lVF8/Ssfuo1hCaII/AAAAAAAAAOc/8RDTPX01C5Y/s400/.003hist.jpg" alt="" id="BLOGGER_PHOTO_ID_5388537864499914882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;这时效果更为理想，有些接近正态分布了。         此时的散点图如下，&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bon1sB2lVF8/Ssfu0GT9SqI/AAAAAAAAAOk/2LbW23DVFbA/s1600-h/.003plot.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_bon1sB2lVF8/Ssfu0GT9SqI/AAAAAAAAAOk/2LbW23DVFbA/s400/.003plot.jpg" alt="" id="BLOGGER_PHOTO_ID_5388538057987017378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;最后尝试，xx= x(find(x&lt;.001));hist(xx)， 这时效果更为理想，更接近正态分布了。     &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_bon1sB2lVF8/Ssfu_A6XydI/AAAAAAAAAOs/qGpkCGfyLsg/s1600-h/.001hist.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_bon1sB2lVF8/Ssfu_A6XydI/AAAAAAAAAOs/qGpkCGfyLsg/s400/.001hist.jpg" alt="" id="BLOGGER_PHOTO_ID_5388538245516085714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;此时的散点图如下，&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bon1sB2lVF8/SsfvNywalGI/AAAAAAAAAO0/AQa5HHRINAE/s1600-h/.001plot.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_bon1sB2lVF8/SsfvNywalGI/AAAAAAAAAO0/AQa5HHRINAE/s400/.001plot.jpg" alt="" id="BLOGGER_PHOTO_ID_5388538499414266978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;所以我们最终决定采取x显示区间为[.0002， .001]，认为此时的效果最好。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;从某种意义上，这是matlab的一个小小缺陷。因为axis auto并不能为我们选取一个适当的尺度来发现数据中隐藏的pattern，或许上面的分析能够改进这个功能的设计。&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;我们的观点是，合适的尺度应该让图中的主要点表现为类正态分布，如此，则人能够更好的把握数据中的pattern.&lt;/span&gt;&lt;br /&gt;&lt;max_x));hist(xx) now="" dislay="" b="" min_x="1/5000;" max_x="" 1="" x="1/n" y="sin(n)" n="1:4000','Location','NorthOutside');" legend=""&gt;&lt;max_x));hist(xx) now="" dislay="" b="" min_x="1/5000;" max_x="" 1="" x="1/n" y="sin(n)" n="1:4000','Location','NorthOutside');" legend=""&gt;&lt;max_x));hist(xx) now="" dislay="" b="" min_x="1/5000;" max_x="" 1="" x="1/n" y="sin(n)" n="1:4000','Location','NorthOutside');" legend=""&gt;&lt;img src="file:///C:/Users/Howell/AppData/Local/Temp/moz-screenshot.png" alt="" /&gt;&lt;img src="file:///C:/Users/Howell/AppData/Local/Temp/moz-screenshot-1.png" alt="" /&gt;&lt;/max_x));hist(xx)&gt;&lt;/max_x));hist(xx)&gt;&lt;/max_x));hist(xx)&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-3314392625424235110?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/3314392625424235110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=3314392625424235110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3314392625424235110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3314392625424235110'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/10/sin1x.html' title='sin(1/x)的内里乾坤'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_bon1sB2lVF8/SsfvpAUw9aI/AAAAAAAAAO8/ymG9L8XlYpY/s72-c/cont.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-3609095793797926984</id><published>2009-07-06T18:03:00.000-07:00</published><updated>2009-07-06T18:04:16.291-07:00</updated><title type='text'>GeomView</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;strong&gt;GeomView and Ubuntu 7.10&lt;/strong&gt;&lt;/div&gt;        &lt;hr style="color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);" size="1"&gt;    &lt;!-- / icon and title --&gt;           &lt;!-- message --&gt;   &lt;div class="vbclean_msgtext" id="post_message_4497768"&gt;Hi all,&lt;br /&gt;&lt;br /&gt;I have installed GeomView on Ubuntu 7.10 with the command:&lt;br /&gt;&lt;br /&gt;% sudo apt-get install geomview&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-3609095793797926984?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/3609095793797926984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=3609095793797926984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3609095793797926984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3609095793797926984'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/07/geomview.html' title='GeomView'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4690322703901508944</id><published>2009-07-06T17:27:00.000-07:00</published><updated>2009-07-06T17:28:17.741-07:00</updated><title type='text'>Maxima</title><content type='html'>http://yenlung.math.nccu.edu.tw/linear/page1/page1.html&lt;br /&gt;&lt;div id="title"&gt;         &lt;h1&gt;線性代數教材區&lt;/h1&gt;          &lt;h2&gt;課程相關講義, 試題等連結或下載&lt;/h2&gt;       &lt;/div&gt;                                 &lt;!-- Start content --&gt;                   &lt;!-- this makes sure the content is long enough for the design --&gt;                    &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/maximalinear.pdf"&gt;Maixma在線性代數的應用             (PDF)&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             Maxima 的使用手冊, PDF 版           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://math.nccu.edu.tw/%7Eyenlung/mynotes/maximalinear_html/maximalinear.html"&gt;             Maixma在線性代數的應用 (HTML)&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             Maxmia 的使用手冊, 線上版           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear101.pdf"&gt;1.1 Introduction&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             為什麼要學線性代數, 數學證明入門。           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear102.pdf"&gt;1.2 Vector Spaces&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             向量空間的基本定義及五個主要例子           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear103.pdf"&gt;1.3 Subspaces&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             子空間 (簡單的證明某個集合是向量空間)           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear104.pdf"&gt;1.4 Linear Combination             and Systems of Linear Equations&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             線性組合和線性系統           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear105.pdf"&gt;1.5 Linear Dependent and             Independent&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             線性相依和線性獨立           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear106.pdf"&gt;1.6 Bases and             Dimension&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             基底是向量空間的主控者           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear201.pdf"&gt;2.1 Linear             Transformations, Null Spaces, and Ranges&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             線性轉換和兩個重要的相關子空間           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear202.pdf"&gt;2.2 The Matrix             Representation of a Linear Transformation&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             線性轉換用矩陣表示           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear203.pdf"&gt;2.3 Composition of Linear             Transformation and Matrix Multiplication&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             兩個線性代數的合成, 對應的就是其表示矩陣相乘           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear204.pdf"&gt;2.4 Invertibility and             Isomorphisms&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             基本列運算和基本矩陣, 計算的核心概念           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/linear/page1/files/linear301.pdf"&gt;3.1 Elementary Row             Operations and Elementary Matrices&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             基本列運算和基本矩陣, 計算的核心概念           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/%7Ecourse/notes/lmaxima/lec01.html"&gt;             線性組合&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             Maxima 筆記系列           &lt;/div&gt;         &lt;/div&gt;          &lt;div class="filesharing-item"&gt;           &lt;div class="filesharing-item-title"&gt;             &lt;a href="http://yenlung.math.nccu.edu.tw/%7Ecourse/notes/lmaxima/lec01.html"&gt;             線性相依&lt;/a&gt;           &lt;/div&gt;            &lt;div class="filesharing-item-description"&gt;             Maxima 筆記系列           &lt;/div&gt;         &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4690322703901508944?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4690322703901508944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4690322703901508944' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4690322703901508944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4690322703901508944'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/07/maxima.html' title='Maxima'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4333605676298176024</id><published>2009-07-06T17:26:00.000-07:00</published><updated>2009-07-06T17:27:18.763-07:00</updated><title type='text'>GNU TeXmacs Tutorial</title><content type='html'>http://www.texmacs.org/Tutorial/&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Starting TeXmacs up&lt;/h2&gt;  &lt;p align="justify"&gt; You may start TeXmacs by typing &lt;/p&gt;&lt;pre&gt;    texmacs &amp;amp;&lt;br /&gt;&lt;/pre&gt; The first time that you start TeXmacs, the program will analyze your system in order to test whether all other packages which are needed by TeXmacs are present on your system. If no problems occur, then a &lt;em&gt;window&lt;/em&gt; with the following aspect should appear on your screen:   &lt;center&gt;   &lt;img src="http://www.texmacs.org/Tutorial/Images/start.png" alt="Starting TeXmacs" border="0" /&gt; &lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4333605676298176024?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4333605676298176024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4333605676298176024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4333605676298176024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4333605676298176024'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/07/gnu-texmacs-tutorial.html' title='GNU TeXmacs Tutorial'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4751152183246189916</id><published>2009-06-15T13:54:00.001-07:00</published><updated>2009-06-15T13:54:11.000-07:00</updated><title type='text'>Bit wise Operations</title><content type='html'>&lt;h2&gt;Bit wise Operations&lt;/h2&gt;      &lt;p&gt;Bitwise operations are operations which occur to the individual     bits of a number.  For example, 5 is written as 101 in base 2, that is,     &lt;tt&gt;5 = 101&lt;sub&gt;2&lt;/sub&gt;&lt;/tt&gt;.  Similarly, &lt;tt&gt;3 = 11&lt;sub&gt;2&lt;/sub&gt;&lt;/tt&gt;.     In this case, operations occur on the individual bits.&lt;/p&gt;      &lt;p&gt;For example, bit-wise and 3 and 5 is the and of the corresponding     bits &lt;tt&gt;101&lt;/tt&gt; and &lt;tt&gt;11&lt;/tt&gt;:&lt;/p&gt;  &lt;pre&gt;&gt;&gt; bitand(3, 5)&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&gt;&gt; bitor(3, 5)&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    7&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;      &lt;p&gt;Relevant functions are:&lt;/p&gt;      &lt;ul&gt;&lt;li&gt;bitand&lt;/li&gt;&lt;li&gt;bitor&lt;/li&gt;&lt;li&gt;bitxor&lt;/li&gt;&lt;li&gt;bitcmp&lt;/li&gt;&lt;li&gt;bitshift&lt;/li&gt;&lt;li&gt;bitset&lt;/li&gt;&lt;li&gt;bitget&lt;/li&gt;&lt;li&gt;bitmax&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4751152183246189916?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4751152183246189916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4751152183246189916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4751152183246189916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4751152183246189916'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/06/bit-wise-operations.html' title='Bit wise Operations'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-9076772502741169685</id><published>2009-03-04T14:55:00.000-08:00</published><updated>2009-03-04T14:57:08.736-08:00</updated><title type='text'>symbolic toolbox matlab</title><content type='html'>today install the symbolic toolbox.&lt;br /&gt;&lt;br /&gt;=========&lt;br /&gt;&lt;br /&gt;% here is a example to plot scalar field with surface and contour&lt;br /&gt;% also the gradient and others&lt;br /&gt;clear;&lt;br /&gt;close all;&lt;br /&gt;&lt;br /&gt;% another scalar field&lt;br /&gt;[X,Y] = meshgrid(-15:.5:15, -10:.5:10);&lt;br /&gt;Z = 5.0 * exp(-X.^2/90 - Y.^2/25);&lt;br /&gt;&lt;br /&gt;%surface of Z(X,Y)&lt;br /&gt;figure,surf(X,Y,Z),colorbar,axis equal&lt;br /&gt;&lt;br /&gt;%contour&lt;br /&gt;figure,&lt;br /&gt;[c,h] = contour(X,Y,Z); clabel(c,h), colorbar,axis equal&lt;br /&gt;&lt;br /&gt;%gradient&lt;br /&gt;[px,py] = gradient(Z,.2,.15);&lt;br /&gt;figure,&lt;br /&gt;[c,h] = contour(X,Y,Z); colorbar,axis equal,hold on&lt;br /&gt;%QUIVER(X,Y,U,V) plots velocity vectors as arrows with components (u,v)&lt;br /&gt;% at the points (x,y).&lt;br /&gt;quiver(X,Y,px,py), hold off, axis image&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-9076772502741169685?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/9076772502741169685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=9076772502741169685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/9076772502741169685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/9076772502741169685'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/03/symbolic-toolbox-matlab.html' title='symbolic toolbox matlab'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-8074154284158395486</id><published>2009-02-25T13:02:00.000-08:00</published><updated>2009-02-25T13:06:21.583-08:00</updated><title type='text'>How to save image without border?</title><content type='html'>=======&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Q:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hi there,&lt;br /&gt;&lt;p&gt;Whenever I save a figure using:&lt;br /&gt;imshow(I)&lt;br /&gt;print frame1.tif -f1 -dtiff&lt;br /&gt;&lt;/p&gt;&lt;p&gt;or by using:&lt;br /&gt;h = imshow(I)&lt;br /&gt;saveas( h, 'frame1.tif', 'tif' )&lt;br /&gt;&lt;/p&gt;&lt;p&gt;, I always get a white border around the image (which is&lt;br /&gt;present in the figure window). Does anyone know how to just&lt;br /&gt;save the image itself with no border around it?&lt;br /&gt;&lt;/p&gt;Thanks&lt;br /&gt;&lt;br /&gt;===&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;A:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt;set(gca, 'position', [0 0 1 1], 'visible', 'off')&lt;br /&gt;&gt;&gt; print(3,'-djpeg','C:\Documents and Settings\My Documents\3.jpg');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;======&lt;br /&gt;Also&lt;br /&gt;&lt;br /&gt;用matlab保存图片的四种方法：&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:100%;color:#333399;"&gt;&lt;strong&gt;1 直接从菜单保存，有fig,eps,jpeg,gif,png,bmp等格式。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;color:#333399;"&gt;&lt;strong&gt;2 edit------〉copy figure，再粘贴到其他程序。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;color:#333399;"&gt;&lt;strong&gt;3 &lt;/strong&gt;&lt;/span&gt;&lt;a target="_blank" href="http://www.baisi.net/viewthread.php?tid=994433"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color:#333399;"&gt;&lt;span class="bold"&gt;用saveas命令保存图片&lt;/span&gt;&lt;strong&gt;。&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;color:#333399;"&gt;&lt;strong&gt;4 使用plot函数后紧接着用print函数。&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;print的三个参数：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;（1）图形句柄，如果图形窗口标题栏是“Figure 3”,则句柄就是3.&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;（2）单引号字符串，指定存储格式。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;用gcf可以获取当前窗口句柄。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;  png格式：'-dpng'&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;  jpeg:      '-djpeg',&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;tiff: '-dtiff'&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;bmp:  '-dbitmap'&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;（3）文件名。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="font-size:100%;color:#333399;"&gt;详细用法请 help print&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#333399;"&gt;例：&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;&gt;&gt; x=-pi:2*pi/300:pi;&lt;br /&gt;&gt;&gt; y=sin(x);&lt;br /&gt;&gt;&gt; plot(x,y);&lt;br /&gt;&gt;&gt; print(gcf,'-dpng','abc.png')    % 保存为png格式的图片。&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#0000ff;"&gt;&gt;&gt; figure(2)             % 新建一个句柄为2的图形窗口。&lt;br /&gt;&gt;&gt; plot(x,cos(x));     % 在句柄为2的图形窗口上画图。&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&gt;&gt; grid&lt;br /&gt;&gt;&gt; print(2,'-djpeg','C:\abc.jpeg'); %将句柄为2的图形保存为jpeg/jpg格式的图片，文件名为'C:\abc.jpeg'。&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-8074154284158395486?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/8074154284158395486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=8074154284158395486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/8074154284158395486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/8074154284158395486'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/02/how-to-save-image-without-border.html' title='How to save image without border?'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-5933673206340458319</id><published>2009-02-16T11:59:00.000-08:00</published><updated>2009-02-16T12:33:42.893-08:00</updated><title type='text'>FSPECIAL</title><content type='html'>help fspecial&lt;br /&gt;&lt;br /&gt; FSPECIAL Create predefined 2-D filters.&lt;br /&gt;    H = FSPECIAL(TYPE) creates a two-dimensional filter H of the&lt;br /&gt;    specified type. Possible values for TYPE are:&lt;br /&gt;&lt;br /&gt;      'average'   averaging filter&lt;br /&gt;      'disk'      circular averaging filter&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;      'gaussian'  Gaussian lowpass filter&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;      'laplacian' filter approximating the 2-D Laplacian operator&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;      'log'       Laplacian of Gaussian filter&lt;/span&gt;&lt;br /&gt;      'motion'    motion filter&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;      'prewitt'   Prewitt horizontal edge-emphasizing filter&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;      'sobel'     Sobel horizontal edge-emphasizing filter&lt;/span&gt;&lt;br /&gt;      'unsharp'   unsharp contrast enhancement filter&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(255, 0, 0);"&gt;Depending on TYPE&lt;/span&gt;, FSPECIAL may take additional parameters&lt;br /&gt;    which you can supply.  These parameters all have default&lt;br /&gt;    values.&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('average',HSIZE) returns an averaging filter H of size&lt;br /&gt;    HSIZE. HSIZE can be a vector specifying the number of rows and columns in&lt;br /&gt;    H or a scalar, in which case H is a square matrix.&lt;br /&gt;    The default HSIZE is [3 3].&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('disk',RADIUS) returns a circular averaging filter&lt;br /&gt;    (pillbox) within the square matrix of side 2*RADIUS+1.&lt;br /&gt;    The default RADIUS is 5.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    H = FSPECIAL('gaussian',HSIZE,SIGMA) returns a rotationally&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    symmetric Gaussian lowpass filter  of size HSIZE with standard&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    deviation SIGMA (positive). HSIZE can be a vector specifying the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    number of rows and columns in H or a scalar, in which case H is a&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    square matrix.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    The default HSIZE is [3 3], the default SIGMA is 0.5.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('laplacian',ALPHA) returns a 3-by-3 filter&lt;br /&gt;    approximating the shape of the two-dimensional Laplacian&lt;br /&gt;    operator. The parameter ALPHA controls the shape of the&lt;br /&gt;    Laplacian and must be in the range 0.0 to 1.0.&lt;br /&gt;    The default ALPHA is 0.2.&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('log',HSIZE,SIGMA) returns a rotationally symmetric&lt;br /&gt;    Laplacian of Gaussian filter of size HSIZE with standard deviation&lt;br /&gt;    SIGMA (positive). HSIZE can be a vector specifying the number of rows&lt;br /&gt;    and columns in H or a scalar, in which case H is a square matrix.&lt;br /&gt;    The default HSIZE is [5 5], the default SIGMA is 0.5.&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('motion',LEN,THETA) returns a filter to approximate, once&lt;br /&gt;    convolved with an image, the linear motion of a camera by LEN pixels,&lt;br /&gt;    with an angle of THETA degrees in a counter-clockwise direction. The&lt;br /&gt;    filter becomes a vector for horizontal and vertical motions.  The&lt;br /&gt;    default LEN is 9, the default THETA is 0, which corresponds to a&lt;br /&gt;    horizontal motion of 9 pixels.&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('prewitt') returns 3-by-3 filter that emphasizes&lt;br /&gt;    horizontal edges by approximating a vertical gradient. If you need to&lt;br /&gt;    emphasize vertical edges, transpose the filter H: H'.&lt;br /&gt;&lt;br /&gt;        [1 1 1;0 0 0;-1 -1 -1].&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('sobel') returns 3-by-3 filter that emphasizes&lt;br /&gt;    horizontal edges utilizing the smoothing effect by approximating a&lt;br /&gt;    vertical gradient. If you need to emphasize vertical edges, transpose&lt;br /&gt;    the filter H: H'.&lt;br /&gt;&lt;br /&gt;        [1 2 1;0 0 0;-1 -2 -1].&lt;br /&gt;&lt;br /&gt;    H = FSPECIAL('unsharp',ALPHA) returns a 3-by-3 unsharp contrast&lt;br /&gt;    enhancement filter. FSPECIAL creates the unsharp filter from the&lt;br /&gt;    negative of the Laplacian filter with parameter ALPHA. ALPHA controls&lt;br /&gt;    the shape of the Laplacian and must be in the range 0.0 to 1.0.&lt;br /&gt;    The default ALPHA is 0.2.&lt;br /&gt;&lt;br /&gt;    Class Support&lt;br /&gt;    -------------&lt;br /&gt;    H is of class double.&lt;br /&gt;&lt;br /&gt;    Example&lt;br /&gt;    -------&lt;br /&gt;       I = imread('cameraman.tif');&lt;br /&gt;       subplot(2,2,1);imshow(I);title('Original Image');&lt;br /&gt;       H = fspecial('motion',20,45);&lt;br /&gt;       MotionBlur = imfilter(I,H,'replicate');&lt;br /&gt;       subplot(2,2,2);imshow(MotionBlur);title('Motion Blurred Image');&lt;br /&gt;       H = fspecial('disk',10);&lt;br /&gt;       blurred = imfilter(I,H,'replicate');&lt;br /&gt;       subplot(2,2,3);imshow(blurred);title('Blurred Image');&lt;br /&gt;       H = fspecial('unsharp');&lt;br /&gt;       sharpened = imfilter(I,H,'replicate');&lt;br /&gt;       subplot(2,2,4);imshow(sharpened);title('Sharpened Image');&lt;br /&gt;       &lt;br /&gt;    See also conv2, edge, filter2, fsamp2, fwind1, fwind2, imfilter.&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc fspecial&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-5933673206340458319?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/5933673206340458319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=5933673206340458319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/5933673206340458319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/5933673206340458319'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/02/fspecial.html' title='FSPECIAL'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-3250240005994229417</id><published>2009-02-16T10:02:00.000-08:00</published><updated>2009-02-16T10:07:36.264-08:00</updated><title type='text'>gradient</title><content type='html'>code&lt;br /&gt;&lt;br /&gt;    [x,y] = meshgrid(-2:.2:2,-1:.15:1);&lt;br /&gt;    z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.15);&lt;br /&gt;    contour(x,y,z), hold on&lt;br /&gt;    quiver(x,y,px,py), hold off, axis image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_bon1sB2lVF8/SZmrUJFLuwI/AAAAAAAAAKQ/lvYHONp1PHo/s1600-h/dd.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_bon1sB2lVF8/SZmrUJFLuwI/AAAAAAAAAKQ/lvYHONp1PHo/s400/dd.bmp" alt="" id="BLOGGER_PHOTO_ID_5303458398728862466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_bon1sB2lVF8/SZmq6BJNpEI/AAAAAAAAAKI/-0GHvCBYEqo/s1600-h/untitl.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 381px;" src="http://1.bp.blogspot.com/_bon1sB2lVF8/SZmq6BJNpEI/AAAAAAAAAKI/-0GHvCBYEqo/s400/untitl.bmp" alt="" id="BLOGGER_PHOTO_ID_5303457949921682498" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-3250240005994229417?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/3250240005994229417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=3250240005994229417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3250240005994229417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3250240005994229417'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2009/02/gradient.html' title='gradient'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_bon1sB2lVF8/SZmrUJFLuwI/AAAAAAAAAKQ/lvYHONp1PHo/s72-c/dd.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-391602735045857685</id><published>2008-10-01T08:17:00.000-07:00</published><updated>2008-10-01T08:23:32.222-07:00</updated><title type='text'>Geometric Spatial Transformation</title><content type='html'>[x y 1]=[w z 1]T&lt;br /&gt;&lt;br /&gt;T = [ t11 t12 0]&lt;br /&gt;       [ t21 t22 0]&lt;br /&gt;       [ t31 t32 1]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-391602735045857685?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/391602735045857685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=391602735045857685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/391602735045857685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/391602735045857685'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/10/geometric-spatial-transformation.html' title='Geometric Spatial Transformation'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4638325954021750955</id><published>2008-09-23T12:37:00.000-07:00</published><updated>2008-09-23T12:39:35.157-07:00</updated><title type='text'>relational operators</title><content type='html'>关系运算&lt;br /&gt;&lt;br /&gt;&gt;&gt; A&lt;br /&gt;&lt;br /&gt;A =&lt;br /&gt;&lt;br /&gt;   1     2&lt;br /&gt;   3     4&lt;br /&gt;&lt;br /&gt;&gt;&gt; B&lt;br /&gt;&lt;br /&gt;B =&lt;br /&gt;&lt;br /&gt;   1     3&lt;br /&gt;   4     2&lt;br /&gt;&lt;br /&gt;&gt;&gt; A &lt; B&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;     0     1&lt;br /&gt;     1     0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt; A &gt;= 2&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;   0     1&lt;br /&gt;   1     1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4638325954021750955?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4638325954021750955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4638325954021750955' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4638325954021750955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4638325954021750955'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/relational-operators.html' title='relational operators'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-994948408428936287</id><published>2008-09-23T12:22:00.000-07:00</published><updated>2008-09-23T12:27:34.524-07:00</updated><title type='text'>index 问题</title><content type='html'>对于二维矩阵，可以用二维的下标引用，这是最直观，自然的。但是在内存中，matlab矩阵的存储次序如何呢，是一列一列的存的。比如，&lt;br /&gt;&lt;br /&gt;&gt;&gt; A = rand(2,5)&lt;br /&gt;&lt;br /&gt;A =&lt;br /&gt;&lt;br /&gt;    0.4089    0.1436    0.0832    0.0304    0.7000&lt;br /&gt;    0.7080    0.8713    0.4617    0.7532    0.2145&lt;br /&gt;&lt;br /&gt;在内存中，则是，&lt;br /&gt;&lt;br /&gt;起始地址 Addr&lt;br /&gt;&lt;br /&gt;Addr ：0.4089 &lt;br /&gt;Addr +1：0.7080&lt;br /&gt;Addr +2：0.1436&lt;br /&gt;Addr +3：0.8713&lt;br /&gt;Addr +4：0.0832&lt;br /&gt;Addr +5：0.4617&lt;br /&gt;。。。&lt;br /&gt;&lt;br /&gt;所以，&lt;br /&gt;&gt;&gt; A(6)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    0.4617&lt;br /&gt;&lt;br /&gt;&gt;&gt; A(2,3)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    0.4617&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-994948408428936287?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/994948408428936287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=994948408428936287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/994948408428936287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/994948408428936287'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/index.html' title='index 问题'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-1341425495601787697</id><published>2008-09-23T12:04:00.000-07:00</published><updated>2008-09-23T12:09:41.102-07:00</updated><title type='text'>MATLAB  functions</title><content type='html'>MATLAB provides a large number of standard elementary mathematical functions, including abs, sqrt, exp, and sin. Taking the square root or logarithm of a negative number is not an error; the appropriate complex result is produced automatically. MATLAB also provides many more advanced mathematical functions, including Bessel and gamma functions. Most of these functions accept complex arguments. For a list of the elementary mathematical functions, type&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;help elfun&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For a list of more advanced mathematical and matrix functions, type&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;help specfun&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;help elmat&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some of the functions, like sqrt and sin, are built in. Built-in functions are part of the MATLAB core so they are very efficient, but the computational details are not readily accessible. Other functions, like gamma and sinh, are implemented in M-files.&lt;br /&gt;&lt;br /&gt;There are some differences between built-in functions and other functions. For example, for built-in functions, you cannot see the code. For other functions, you can see the code and even modify it if you want.&lt;br /&gt;&lt;br /&gt;Several &lt;span style="color: rgb(255, 0, 0);"&gt;special functions provide values of useful constants.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;pi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.14159265...&lt;br /&gt;&lt;br /&gt;i&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Imaginary unit,&lt;br /&gt;&lt;br /&gt;j&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Same as i&lt;br /&gt;&lt;br /&gt;eps&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Floating-point relative precision,&lt;br /&gt;&lt;br /&gt;realmin&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Smallest floating-point number,&lt;br /&gt;&lt;br /&gt;realmax&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Largest floating-point number,&lt;br /&gt;&lt;br /&gt;Inf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Infinity&lt;br /&gt;&lt;br /&gt;NaN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Not-a-number&lt;br /&gt;&lt;br /&gt;Infinity is generated by dividing a nonzero value by zero, or by evaluating well defined mathematical expressions that overflow, i.e., exceed realmax. Not-a-number is generated by trying to evaluate expressions like 0/0 or Inf-Inf that do not have well defined mathematical values.&lt;br /&gt;&lt;br /&gt;The function names are not reserved. It is possible to overwrite any of them with a new variable, such as&lt;br /&gt;&lt;br /&gt;eps = 1.e-6&lt;br /&gt;&lt;br /&gt;and then use that value in subsequent calculations. The original function can be restored with&lt;br /&gt;&lt;br /&gt;clear eps&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&gt;&gt; help elfun&lt;/span&gt;&lt;br /&gt; Elementary math functions.&lt;br /&gt;&lt;br /&gt; Trigonometric.&lt;br /&gt;   sin         - Sine.&lt;br /&gt;   sind        - Sine of argument in degrees.&lt;br /&gt;   sinh        - Hyperbolic sine.&lt;br /&gt;   asin        - Inverse sine.&lt;br /&gt;   asind       - Inverse sine, result in degrees.&lt;br /&gt;   asinh       - Inverse hyperbolic sine.&lt;br /&gt;   cos         - Cosine.&lt;br /&gt;   cosd        - Cosine of argument in degrees.&lt;br /&gt;   cosh        - Hyperbolic cosine.&lt;br /&gt;   acos        - Inverse cosine.&lt;br /&gt;   acosd       - Inverse cosine, result in degrees.&lt;br /&gt;   acosh       - Inverse hyperbolic cosine.&lt;br /&gt;   tan         - Tangent.&lt;br /&gt;   tand        - Tangent of argument in degrees.&lt;br /&gt;   tanh        - Hyperbolic tangent.&lt;br /&gt;   atan        - Inverse tangent.&lt;br /&gt;   atand       - Inverse tangent, result in degrees.&lt;br /&gt;   atan2       - Four quadrant inverse tangent.&lt;br /&gt;   atanh       - Inverse hyperbolic tangent.&lt;br /&gt;   sec         - Secant.&lt;br /&gt;   secd        - Secant of argument in degrees.&lt;br /&gt;   sech        - Hyperbolic secant.&lt;br /&gt;   asec        - Inverse secant.&lt;br /&gt;   asecd       - Inverse secant, result in degrees.&lt;br /&gt;   asech       - Inverse hyperbolic secant.&lt;br /&gt;   csc         - Cosecant.&lt;br /&gt;   cscd        - Cosecant of argument in degrees.&lt;br /&gt;   csch        - Hyperbolic cosecant.&lt;br /&gt;   acsc        - Inverse cosecant.&lt;br /&gt;   acscd       - Inverse cosecant, result in degrees.&lt;br /&gt;   acsch       - Inverse hyperbolic cosecant.&lt;br /&gt;   cot         - Cotangent.&lt;br /&gt;   cotd        - Cotangent of argument in degrees.&lt;br /&gt;   coth        - Hyperbolic cotangent.&lt;br /&gt;   acot        - Inverse cotangent.&lt;br /&gt;   acotd       - Inverse cotangent, result in degrees.&lt;br /&gt;   acoth       - Inverse hyperbolic cotangent.&lt;br /&gt;   hypot       - Square root of sum of squares.&lt;br /&gt;&lt;br /&gt; Exponential.&lt;br /&gt;   exp         - Exponential.&lt;br /&gt;   expm1       - Compute exp(x)-1 accurately.&lt;br /&gt;   log         - Natural logarithm.&lt;br /&gt;   log1p       - Compute log(1+x) accurately.&lt;br /&gt;   log10       - Common (base 10) logarithm.&lt;br /&gt;   log2        - Base 2 logarithm and dissect floating point number.&lt;br /&gt;   pow2        - Base 2 power and scale floating point number.&lt;br /&gt;   realpow     - Power that will error out on complex result.&lt;br /&gt;   reallog     - Natural logarithm of real number.&lt;br /&gt;   realsqrt    - Square root of number greater than or equal to zero.&lt;br /&gt;   sqrt        - Square root.&lt;br /&gt;   nthroot     - Real n-th root of real numbers.&lt;br /&gt;   nextpow2    - Next higher power of 2.&lt;br /&gt;&lt;br /&gt; Complex.&lt;br /&gt;   abs         - Absolute value.&lt;br /&gt;   angle       - Phase angle.&lt;br /&gt;   complex     - Construct complex data from real and imaginary parts.&lt;br /&gt;   conj        - Complex conjugate.&lt;br /&gt;   imag        - Complex imaginary part.&lt;br /&gt;   real        - Complex real part.&lt;br /&gt;   unwrap      - Unwrap phase angle.&lt;br /&gt;   isreal      - True for real array.&lt;br /&gt;   cplxpair    - Sort numbers into complex conjugate pairs.&lt;br /&gt;&lt;br /&gt; Rounding and remainder.&lt;br /&gt;   fix         - Round towards zero.&lt;br /&gt;   floor       - Round towards minus infinity.&lt;br /&gt;   ceil        - Round towards plus infinity.&lt;br /&gt;   round       - Round towards nearest integer.&lt;br /&gt;   mod         - Modulus (signed remainder after division).&lt;br /&gt;   rem         - Remainder after division.&lt;br /&gt;   sign        - Signum.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&gt;&gt; help elmat&lt;/span&gt;&lt;br /&gt; Elementary matrices and matrix manipulation.&lt;br /&gt;&lt;br /&gt; Elementary matrices.&lt;br /&gt;   zeros       - Zeros array.&lt;br /&gt;   ones        - Ones array.&lt;br /&gt;   eye         - Identity matrix.&lt;br /&gt;   repmat      - Replicate and tile array.&lt;br /&gt;   rand        - Uniformly distributed random numbers.&lt;br /&gt;   randn       - Normally distributed random numbers.&lt;br /&gt;   linspace    - Linearly spaced vector.&lt;br /&gt;   logspace    - Logarithmically spaced vector.&lt;br /&gt;   freqspace   - Frequency spacing for frequency response.&lt;br /&gt;   meshgrid    - X and Y arrays for 3-D plots.&lt;br /&gt;   accumarray  - Construct an array with accumulation.&lt;br /&gt;   :           - Regularly spaced vector and index into matrix.&lt;br /&gt;&lt;br /&gt; Basic array information.&lt;br /&gt;   size        - Size of array.&lt;br /&gt;   length      - Length of vector.&lt;br /&gt;   ndims       - Number of dimensions.&lt;br /&gt;   numel       - Number of elements.&lt;br /&gt;   disp        - Display matrix or text.&lt;br /&gt;   isempty     - True for empty array.&lt;br /&gt;   isequal     - True if arrays are numerically equal.&lt;br /&gt;   isequalwithequalnans - True if arrays are numerically equal.&lt;br /&gt;&lt;br /&gt; Matrix manipulation.&lt;br /&gt;   cat         - Concatenate arrays.&lt;br /&gt;   reshape     - Change size.&lt;br /&gt;   diag        - Diagonal matrices and diagonals of matrix.&lt;br /&gt;   blkdiag     - Block diagonal concatenation.&lt;br /&gt;   tril        - Extract lower triangular part.&lt;br /&gt;   triu        - Extract upper triangular part.&lt;br /&gt;   fliplr      - Flip matrix in left/right direction.&lt;br /&gt;   flipud      - Flip matrix in up/down direction.&lt;br /&gt;   flipdim     - Flip matrix along specified dimension.&lt;br /&gt;   rot90       - Rotate matrix 90 degrees.&lt;br /&gt;   :           - Regularly spaced vector and index into matrix.&lt;br /&gt;   find        - Find indices of nonzero elements.&lt;br /&gt;   end         - Last index.&lt;br /&gt;   sub2ind     - Linear index from multiple subscripts.&lt;br /&gt;   ind2sub     - Multiple subscripts from linear index.&lt;br /&gt;   bsxfun      - Binary singleton expansion function.&lt;br /&gt;&lt;br /&gt; Multi-dimensional array functions.&lt;br /&gt;   ndgrid      - Generate arrays for N-D functions and interpolation.&lt;br /&gt;   permute     - Permute array dimensions.&lt;br /&gt;   ipermute    - Inverse permute array dimensions.&lt;br /&gt;   shiftdim    - Shift dimensions.&lt;br /&gt;   circshift   - Shift array circularly.&lt;br /&gt;   squeeze     - Remove singleton dimensions.&lt;br /&gt;&lt;br /&gt; Array utility functions.&lt;br /&gt;   isscalar    - True for scalar.&lt;br /&gt;   isvector    - True for vector.&lt;br /&gt;&lt;br /&gt; Special variables and constants.&lt;br /&gt;   ans         - Most recent answer.&lt;br /&gt;   eps         - Floating point relative accuracy.&lt;br /&gt;   realmax     - Largest positive floating point number.&lt;br /&gt;   realmin     - Smallest positive floating point number.&lt;br /&gt;   pi          - 3.1415926535897....&lt;br /&gt;   i           - Imaginary unit.&lt;br /&gt;   inf         - Infinity.&lt;br /&gt;   nan         - Not-a-Number.&lt;br /&gt;   isnan       - True for Not-a-Number.&lt;br /&gt;   isinf       - True for infinite elements.&lt;br /&gt;   isfinite    - True for finite elements.&lt;br /&gt;   j           - Imaginary unit.&lt;br /&gt;   why         - Succinct answer.&lt;br /&gt;&lt;br /&gt; Specialized matrices.&lt;br /&gt;   compan      - Companion matrix.&lt;br /&gt;   gallery     - Higham test matrices.&lt;br /&gt;   hadamard    - Hadamard matrix.&lt;br /&gt;   hankel      - Hankel matrix.&lt;br /&gt;   hilb        - Hilbert matrix.&lt;br /&gt;   invhilb     - Inverse Hilbert matrix.&lt;br /&gt;   magic       - Magic square.&lt;br /&gt;   pascal      - Pascal matrix.&lt;br /&gt;   rosser      - Classic symmetric eigenvalue test problem.&lt;br /&gt;   toeplitz    - Toeplitz matrix.&lt;br /&gt;   vander      - Vandermonde matrix.&lt;br /&gt;   wilkinson   - Wilkinson's eigenvalue test matrix.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&gt;&gt; help specfun&lt;/span&gt;&lt;br /&gt; Specialized math functions.&lt;br /&gt;&lt;br /&gt; Specialized math functions.&lt;br /&gt;   airy        - Airy functions.&lt;br /&gt;   besselj     - Bessel function of the first kind.&lt;br /&gt;   bessely     - Bessel function of the second kind.&lt;br /&gt;   besselh     - Bessel functions of the third kind (Hankel function).&lt;br /&gt;   besseli     - Modified Bessel function of the first kind.&lt;br /&gt;   besselk     - Modified Bessel function of the second kind.&lt;br /&gt;   beta        - Beta function.&lt;br /&gt;   betainc     - Incomplete beta function.&lt;br /&gt;   betaln      - Logarithm of beta function.&lt;br /&gt;   ellipj      - Jacobi elliptic functions.&lt;br /&gt;   ellipke     - Complete elliptic integral.&lt;br /&gt;   erf         - Error function.&lt;br /&gt;   erfc        - Complementary error function.&lt;br /&gt;   erfcx       - Scaled complementary error function.&lt;br /&gt;   erfinv      - Inverse error function.&lt;br /&gt;   expint      - Exponential integral function.&lt;br /&gt;   gamma       - Gamma function.&lt;br /&gt;   gammainc    - Incomplete gamma function.&lt;br /&gt;   gammaln     - Logarithm of gamma function.&lt;br /&gt;   psi         - Psi (polygamma) function.&lt;br /&gt;   legendre    - Associated Legendre function.&lt;br /&gt;   cross       - Vector cross product.&lt;br /&gt;   dot         - Vector dot product.&lt;br /&gt;&lt;br /&gt; Number theoretic functions.&lt;br /&gt;   factor      - Prime factors.&lt;br /&gt;   isprime     - True for prime numbers.&lt;br /&gt;   primes      - Generate list of prime numbers.&lt;br /&gt;   gcd         - Greatest common divisor.&lt;br /&gt;   lcm         - Least common multiple.&lt;br /&gt;   rat         - Rational approximation.&lt;br /&gt;   rats        - Rational output.&lt;br /&gt;   perms       - All possible permutations.&lt;br /&gt;   nchoosek    - All combinations of N elements taken K at a time.&lt;br /&gt;   factorial   - Factorial function.&lt;br /&gt;&lt;br /&gt; Coordinate transforms.&lt;br /&gt;   cart2sph    - Transform Cartesian to spherical coordinates.&lt;br /&gt;   cart2pol    - Transform Cartesian to polar coordinates.&lt;br /&gt;   pol2cart    - Transform polar to Cartesian coordinates.&lt;br /&gt;   sph2cart    - Transform spherical to Cartesian coordinates.&lt;br /&gt;   hsv2rgb     - Convert hue-saturation-value colors to red-green-blue.&lt;br /&gt;   rgb2hsv     - Convert red-green-blue colors to hue-saturation-value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-1341425495601787697?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/1341425495601787697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=1341425495601787697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/1341425495601787697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/1341425495601787697'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/matlab-functions.html' title='MATLAB  functions'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-6089684083785742370</id><published>2008-09-11T11:53:00.000-07:00</published><updated>2008-09-11T11:54:32.761-07:00</updated><title type='text'>Save workspace variables to disk</title><content type='html'>save -&lt;br /&gt;Save workspace variables to disk&lt;br /&gt;&lt;br /&gt;Graphical Interface&lt;br /&gt;&lt;br /&gt;As an alternative to the save function, select Save Workspace As from the File menu in the MATLAB® desktop, or use the Workspace browser.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;save&lt;br /&gt;save filename&lt;br /&gt;save filename content&lt;br /&gt;save filename options&lt;br /&gt;save filename content options&lt;br /&gt;save('filename', 'var1', 'var2', ...)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Examples&lt;br /&gt;&lt;br /&gt;Example 1&lt;br /&gt;Save all variables from the workspace in binary MAT-file test.mat:&lt;br /&gt;save test.mat&lt;br /&gt;Example 2&lt;br /&gt;Save variables p and q in binary MAT-file test.mat.&lt;br /&gt;In this example, the file name is stored in a variable, savefile. You must call save using the function syntax of the command if you intend to reference the file name through a variable.&lt;br /&gt;savefile = 'test.mat';&lt;br /&gt;p = rand(1, 10);&lt;br /&gt;q = ones(10);&lt;br /&gt;save(savefile, 'p', 'q')&lt;br /&gt;Example 3&lt;br /&gt;Save the variables vol and temp in ASCII format to a file named june10:&lt;br /&gt;save('d:\mymfiles\june10','vol','temp','-ASCII')&lt;br /&gt;Example 4&lt;br /&gt;Save the fields of structure s1 as individual variables rather than as an entire structure.&lt;br /&gt;s1.a = 12.7;  s1.b = {'abc', [4 5; 6 7]};  s1.c = 'Hello!';&lt;br /&gt;save newstruct.mat -struct s1;&lt;br /&gt;clear&lt;br /&gt;Check what was saved to newstruct.mat:&lt;br /&gt;whos -file newstruct.mat&lt;br /&gt;  Name      Size                   Bytes  Class&lt;br /&gt;&lt;br /&gt;  a         1x1                        8  double array&lt;br /&gt;  b         1x2                      158  cell array&lt;br /&gt;  c         1x6                       12  char array&lt;br /&gt;&lt;br /&gt;Grand total is 16 elements using 178 bytes&lt;br /&gt;Read only the b field into the MATLAB workspace.&lt;br /&gt;str = load('newstruct.mat', 'b')&lt;br /&gt;str = &lt;br /&gt;    b: {'abc'  [2x2 double]}&lt;br /&gt;Example 5&lt;br /&gt;Using regular expressions, save in MAT-file mydata.mat those variables with names that begin with Mon, Tue, or Wed:&lt;br /&gt;save('mydata', '-regexp', '^Mon|^Tue|^Wed');&lt;br /&gt;Here is another way of doing the same thing. In this case, there are three separate expression arguments:&lt;br /&gt;save('mydata', '-regexp', '^Mon', '^Tue', '^Wed');&lt;br /&gt;Example 6&lt;br /&gt;Save a 3000-by-3000 matrix uncompressed to file c1.mat, and compressed to file c2.mat. The compressed file uses about one quarter the disk space required to store the uncompressed data:&lt;br /&gt;x = ones(3000);&lt;br /&gt;y = uint32(rand(3000) * 100);&lt;br /&gt;&lt;br /&gt;save -v6 c1 x y     % Save without compression&lt;br /&gt;save -v7 c2 x y     % Save with compression&lt;br /&gt;&lt;br /&gt;d1 = dir('c1.mat');&lt;br /&gt;d2 = dir('c2.mat');&lt;br /&gt;&lt;br /&gt;d1.bytes&lt;br /&gt;ans =&lt;br /&gt;    45000240          % Size of the uncompressed data in bytes.&lt;br /&gt;d2.bytes&lt;br /&gt;ans =&lt;br /&gt;    11985283          % Size of the compressed data in bytes.&lt;br /&gt;&lt;br /&gt;d2.bytes/d1.bytes&lt;br /&gt;ans =&lt;br /&gt;    0.2663            % Ratio of compressed to uncompressed&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-6089684083785742370?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/6089684083785742370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=6089684083785742370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/6089684083785742370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/6089684083785742370'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/save-workspace-variables-to-disk.html' title='Save workspace variables to disk'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-2296131184567712980</id><published>2008-09-08T14:13:00.000-07:00</published><updated>2008-09-08T14:22:09.133-07:00</updated><title type='text'>tips</title><content type='html'>You can also assign a scalar to all entries of a submatrix. Try:&lt;br /&gt;A(:, [2 4]) = 99&lt;br /&gt;&lt;br /&gt;You can delete rows or columns of a matrix by assigning the empty matrix ([]) to them. Try:&lt;br /&gt;A(:, [2 4]) = []&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt; x= rand(1,5)&lt;br /&gt;&lt;br /&gt;x =&lt;br /&gt;&lt;br /&gt;    0.7513    0.2551    0.5060    0.6991    0.8909&lt;br /&gt;&lt;br /&gt;&gt;&gt; x = x(end:-1:1)&lt;br /&gt;&lt;br /&gt;x =&lt;br /&gt;&lt;br /&gt;    0.8909    0.6991    0.5060    0.2551    0.7513&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-2296131184567712980?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/2296131184567712980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=2296131184567712980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2296131184567712980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2296131184567712980'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/tips.html' title='tips'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-5137131656633887053</id><published>2008-09-04T07:56:00.000-07:00</published><updated>2008-09-04T10:52:38.745-07:00</updated><title type='text'>Basic 2-d Plot Commands</title><content type='html'>Basic 2-d Plot Commands&lt;br /&gt;&lt;br /&gt;The basic command for plotting in Matlab is: plot(x,y). The important thing to remember is that in Matlab, variables such as x and y are matrices, which must be of the same size. The plot command simply creates a figure window and plots the data in the variable x versus those in y and interpolates linearly between the points. If x is a vector and y are a matrix, then plot(x,y) will plot the rows or columns of y versus the vector x, depending on whether the row or column length matches the length of x.&lt;br /&gt;&lt;br /&gt;We are interested in using Matlab to plot functions. The important point is: all built in functions in Matlab are vectorized. This means that if x is a matrix, then the command sin(x) will create a matrix of the same size whose entries are computed by taking the sine of each entry of x. Hence, to create a plot of sin(x) on say the interval [-pi,pi] we would use:&lt;br /&gt;&lt;br /&gt;&gt;&gt;x=-pi:pi/20:pi;&lt;br /&gt;&gt;&gt;plot(x,sin(x))&lt;br /&gt;&lt;br /&gt;The first line creates a vector of data for the independent variable; the step size is pi/20. To find out how long the vector is type&lt;br /&gt;&lt;br /&gt;&gt;&gt;length(x) % no semicolon produces output&lt;br /&gt;&lt;br /&gt;ans = 41 % this is the form of output&lt;br /&gt;&lt;br /&gt;Alternatively, we could type&lt;br /&gt;&lt;br /&gt;&gt;&gt;size(x)&lt;br /&gt;&lt;br /&gt;ans = 1 41 % x is a row vector of length 41&lt;br /&gt;&lt;br /&gt;Multiple plots on the same axis can be done in two ways.&lt;br /&gt;&lt;br /&gt;&gt;&gt;x=-pi:pi/20:pi;&lt;br /&gt;&gt;&gt;plot(x,sin(x))&lt;br /&gt;&gt;&gt;hold on % this command forces the same set of axis for further plots&lt;br /&gt;&gt;&gt;plot(x,cos(x))&lt;br /&gt;&gt;&gt;grid on % places a grid on the axis&lt;br /&gt;&gt;&gt;hold off % future plot commands will go to a new set of axis&lt;br /&gt;&lt;br /&gt;Alternatively, the same thing can be accomplished with the command&lt;br /&gt;&lt;br /&gt;&gt;&gt;plot(x,sin(x),x,cos(x))&lt;br /&gt;&lt;br /&gt;Either way produces something like the following output.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Alternatively, one may wish to plot the two functions in the same figure window but on a different set of axes. The command is&lt;br /&gt;&lt;br /&gt;&gt;&gt;subplot(1,2,1),plot(x,sin(x))&lt;br /&gt;&gt;&gt;grid on&lt;br /&gt;&gt;&gt;subplot(1,2,2),plot(x,cos(x))&lt;br /&gt;&gt;&gt;grid on&lt;br /&gt;&lt;br /&gt;NOTE: If you forget to type grid on, or any other axis command below after the first plot, simply click on the axis region and then type the command.&lt;br /&gt;&lt;br /&gt;The output looks like:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Several observations are in order:&lt;br /&gt;&lt;br /&gt;The x-axis ranges from -4 to 4, not matching the original data.&lt;br /&gt;Except for color, we cannot distinguish between the graphs.&lt;br /&gt;The axes are not labeled.&lt;br /&gt;Are there other line styles?&lt;br /&gt;There is no title on the figure.&lt;br /&gt;Can we control the tick mark positions on the x and y axes?&lt;br /&gt;Axis commands:&lt;br /&gt;&lt;br /&gt;axis tight (Sets axis limits to the range of the plotted data).&lt;br /&gt;axis([xmin xmax ymin ymax]) (Used before the plot command, sets the limits as given in the vector)&lt;br /&gt;axis equal (Set the aspect ratio so that equal tick mark increments have the same size on each axis)&lt;br /&gt;axis normal (Restore the axis box to full size and removes any restriction on scaling)&lt;br /&gt;axis off (Turn off the axis, tick marks, and background)&lt;br /&gt;axis on (Turn on the axis, tick marks, and background)&lt;br /&gt;Line styles. The curves depicted in a given set of axis can have a variety of line styles. For example&lt;br /&gt;&lt;br /&gt;&gt;&gt;plot(x,sin(x),x,cos(x),'--') % plots sin(x) and cos(x) on the same axis with cosine plotted with a dashed line&lt;br /&gt;&lt;br /&gt;&gt;&gt;plot(x,sin(x),'LineWidth',2) % plots sin(x) with line thickness of 2 points; default is 0.5; possible choices 2,3,4.&lt;br /&gt;&lt;br /&gt;Labeling the axis:&lt;br /&gt;&lt;br /&gt;xlabel('string') % string represents the desired label&lt;br /&gt;ylabel('string')&lt;br /&gt;zlabel('string') % For use in 3-d plots&lt;br /&gt;Annotating the plot:&lt;br /&gt;&lt;br /&gt;legend('string1','string2',.....,m)&lt;br /&gt;The strings string1, string2, etc are the desired labels for the different functions plotted. The variable m placed at the end specifies the position of the legend box: m=1, upper right hand corner, m=2 upper left hand corner, m=3 lower left hand corner, m=4 lower right hand corner, m=-1 to the right of the axis, without m specified the default is m=1.&lt;br /&gt;gtext('string')&lt;br /&gt;This command transforms the mouse pointer into crosshairs over the plot, when clicked over a desired position, the string will appear on the plot.&lt;br /&gt;Plot title command:&lt;br /&gt;&lt;br /&gt;title('string') % places string above the plot&lt;br /&gt;gtext can be used as above for manual positioning of a title.&lt;br /&gt;Tick mark values can be set with the command:&lt;br /&gt;&lt;br /&gt;set(gca,'xtick',[vector of values])&lt;br /&gt;gca means : get current axis object&lt;br /&gt;'xtick' : could be 'ytick' or 'ztick'&lt;br /&gt;[vector of values] : you specify the numerical values for the ticks.&lt;br /&gt;&lt;br /&gt;Example: Sine &amp; Cosine Plots&lt;br /&gt;&lt;br /&gt;This example makes use of a variety of the above commands.&lt;br /&gt;&lt;br /&gt;&gt;&gt;x=-pi:pi/20:pi;&lt;br /&gt;&gt;&gt;plot(x,sin(x),x,cos(x),'--',2)&lt;br /&gt;&gt;&gt;axis tight&lt;br /&gt;&gt;&gt;legend('sin(x)','cos(x)',2)&lt;br /&gt;&gt;&gt;title('An Example Plot')&lt;br /&gt;&gt;&gt;xlabel('x'); ylabel('y')&lt;br /&gt;&gt;&gt;set(gca,'xtick',[-3 0 3])&lt;br /&gt;&gt;&gt;grid on&lt;br /&gt;&lt;br /&gt;The output should look something like:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NOTE: Many of the plot refinements can be done from the figure window. Look under the Tool menu in the figure window. The tool bar also offers a variety of ways to edit the plot.&lt;br /&gt;&lt;br /&gt;Example: Roots of an equation&lt;br /&gt;&lt;br /&gt;Here we will obtain a plot of tan(pi*x) and -x. This is a graphical depiction of the roots of the equation tan(pi*x)=-x.&lt;br /&gt;&lt;br /&gt;» x=-0.495:0.005:0.495; % vector for x&lt;br /&gt;» x=[x x+1 x+2 x+3 x+4]; % making use of periodicity and avoiding singularities&lt;br /&gt;» plot(x,tan(pi*x),'LineWidth',2)&lt;br /&gt;» hold on&lt;br /&gt;» axis([0 4.5 -6 4]) % adjusting the axis limits&lt;br /&gt;» plot(x,-x) % plotting the line&lt;br /&gt;» plot(x,zeros(length(x))) % plotting a horizontal line&lt;br /&gt;» title('tan\pi\lambda = -\lambda')&lt;br /&gt;» title('tan\pi\lambda = -\lambda : Graphical Depiction of Roots')&lt;br /&gt;» gtext('\lambda_{1}')&lt;br /&gt;» gtext('\lambda_{2}')&lt;br /&gt;» gtext('\lambda_{3}')&lt;br /&gt;» gtext('\lambda_{4}')&lt;br /&gt;&lt;br /&gt;NOTE: In the last five lines we have used a LaTex interpreter built into Matlab for writing Greek letters. The backslash \ invokes the interpreter, LaTex command for Greek letters is to spell them, and the _{k} forces a subscript. The output looks as follows.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;WARNING: In Matlab, the operand +, -, *, / are all matrix operations.&lt;br /&gt;&lt;br /&gt;There is no problem with the first two: if x is a matrix, then x+5 simply adds 5 to every entry in x. However, if x and y are matrices of the same size, x*y performs matrix multiplication. If you want multiplication to be done element by element, the command is x.*y.&lt;br /&gt;&lt;br /&gt;For example, if you want to plot the polynomial function (x^4-1)(x+3) on the interval [-4,2] one could write&lt;br /&gt;&lt;br /&gt;&gt;&gt;x=-4:0.1:2;&lt;br /&gt;&gt;&gt;plot(x,(x.^4-1).*(x+3))&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-5137131656633887053?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/5137131656633887053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=5137131656633887053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/5137131656633887053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/5137131656633887053'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/basic-2-d-plot-commands.html' title='Basic 2-d Plot Commands'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-7108024663562984902</id><published>2008-09-02T12:19:00.000-07:00</published><updated>2008-09-02T12:53:25.761-07:00</updated><title type='text'>验证一个命题</title><content type='html'>假设，C为mxn矩阵&lt;br /&gt;则有&lt;br /&gt;trace(C'*C)=norm(C,'fro');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt; C = rand(3,3)&lt;br /&gt;&lt;br /&gt;C =&lt;br /&gt;&lt;br /&gt;    0.4898    0.7094    0.6797&lt;br /&gt;    0.4456    0.7547    0.6551&lt;br /&gt;    0.6463    0.2760    0.1626&lt;br /&gt;&lt;br /&gt;&gt;&gt; trace(C'*C)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.9227&lt;br /&gt;&lt;br /&gt;&gt;&gt; norm(C,'fro')*norm(C,'fro')&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.9227&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;help norm&lt;br /&gt; NORM   Matrix or vector norm.&lt;br /&gt;    For matrices...&lt;br /&gt;      NORM(X) is the largest singular value of X, max(svd(X)).&lt;br /&gt;      NORM(X,2) is the same as NORM(X).&lt;br /&gt;      NORM(X,1) is the 1-norm of X, the largest column sum,&lt;br /&gt;                      = max(sum(abs(X))).&lt;br /&gt;      NORM(X,inf) is the infinity norm of X, the largest row sum,&lt;br /&gt;                      = max(sum(abs(X'))).&lt;br /&gt;      NORM(X,'fro') is the Frobenius norm, sqrt(sum(diag(X'*X))).&lt;br /&gt;      NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.&lt;br /&gt; &lt;br /&gt;    For vectors...&lt;br /&gt;      NORM(V,P) = sum(abs(V).^P)^(1/P).&lt;br /&gt;      NORM(V) = norm(V,2).&lt;br /&gt;      NORM(V,inf) = max(abs(V)).&lt;br /&gt;      NORM(V,-inf) = min(abs(V)).&lt;br /&gt; &lt;br /&gt;    See also cond, rcond, condest, normest, hypot.&lt;br /&gt;&lt;br /&gt;    Overloaded methods:&lt;br /&gt;       lti/norm&lt;br /&gt;       distributed/norm&lt;br /&gt;       mfilt.norm&lt;br /&gt;       adaptfilt.norm&lt;br /&gt;       idmodel/norm&lt;br /&gt;       dfilt.norm&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc norm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-7108024663562984902?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/7108024663562984902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=7108024663562984902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/7108024663562984902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/7108024663562984902'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/blog-post.html' title='验证一个命题'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-3372481485105257881</id><published>2008-09-02T11:56:00.000-07:00</published><updated>2008-09-02T12:01:44.994-07:00</updated><title type='text'>用matlab验证一个命题</title><content type='html'>设A(m,n),B(m,n)为同型矩阵。&lt;br /&gt;&lt;br /&gt;定义，A,B的内积A：B==对应元素相乘后求和。&lt;br /&gt;&lt;br /&gt;用Matlab的语言即&lt;br /&gt;&lt;br /&gt;A：B = sum(sum(A.*B))&lt;br /&gt;&lt;br /&gt;其实A：B 还可用迹来表示，&lt;br /&gt;&lt;br /&gt;A：B = trace(A'*B) = trace(B'*A)&lt;br /&gt;&lt;br /&gt;利用矩阵的知识，上述命题证明是很简单的。&lt;br /&gt;&lt;br /&gt;现用实验的办法，用MAtlab验证如下，&lt;br /&gt;&lt;br /&gt;&gt;&gt; A = rand(3,3)&lt;br /&gt;&lt;br /&gt;A =&lt;br /&gt;&lt;br /&gt;    0.7922    0.0357    0.6787&lt;br /&gt;    0.9595    0.8491    0.7577&lt;br /&gt;    0.6557    0.9340    0.7431&lt;br /&gt;&lt;br /&gt;&gt;&gt; B = rand(3,3)&lt;br /&gt;&lt;br /&gt;B =&lt;br /&gt;&lt;br /&gt;    0.3922    0.7060    0.0462&lt;br /&gt;    0.6555    0.0318    0.0971&lt;br /&gt;    0.1712    0.2769    0.8235&lt;br /&gt;&lt;br /&gt;&gt;&gt; sum(sum(A.*B))&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.0797&lt;br /&gt;&lt;br /&gt;&gt;&gt; trace(A'*B)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.0797&lt;br /&gt;&lt;br /&gt;&gt;&gt; trace(A*B)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.0976&lt;br /&gt;&lt;br /&gt;&gt;&gt; trace(B'*A)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.0797&lt;br /&gt;&lt;br /&gt;&gt;&gt; trace(B*A)&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    2.0976&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-3372481485105257881?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/3372481485105257881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=3372481485105257881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3372481485105257881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3372481485105257881'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/09/matlab.html' title='用matlab验证一个命题'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-1578409284342547545</id><published>2008-08-19T09:07:00.000-07:00</published><updated>2008-08-19T09:08:01.907-07:00</updated><title type='text'>Matlab - An Introduction to Combinatorics</title><content type='html'>&lt;h2 class="post-title"&gt;                         &lt;a href="http://www.blinkdagger.com/matlab/matlab-a-introduction-to-combinatorics" rel="bookmark" title="Permanent Link: Matlab - An Introduction to Combinatorics"&gt;Matlab - An Introduction to Combinatorics&lt;/a&gt;             &lt;/h2&gt;                 &lt;p class="post-info"&gt;                 &lt;em class="date"&gt;07 Apr 2008&lt;/em&gt; &lt;em class="user"&gt;&lt;a href="http://www.blinkdagger.com/author/misterturtie/" title="Posts by Quan Quach"&gt;&lt;/a&gt;&lt;/em&gt;                &lt;/p&gt;                          &lt;p&gt;&lt;em&gt;This is a guest post by &lt;a href="http://matlabdatamining.blogspot.com/"&gt;Will Dwinnell&lt;/a&gt;. Will Dwinnell is a senior-level data miner who shares with us a common love for Matlab. Daniel and I have enjoy reading his blog, and we are extremely excited to introduce Will to our readers. &lt;/em&gt;&lt;/p&gt; &lt;h2 id="toc-introduction"&gt;Introduction&lt;/h2&gt; &lt;p&gt;&lt;img src="http://www.blinkdagger.com/tutorials/matlab/matlab-icon.jpg" alt="Matlab Logo" align="left" hspace="10" /&gt;MATLAB is used in a many fields and consequently includes a diverse array of functions. Many useful functions go neglected by programmers who are unfamiliar with them. This article will briefly explore three functions which may come in handy from time to time, even if they never become everyday workhorses. Specifically, these functions deal with combinations of items.&lt;/p&gt; &lt;h2 id="toc-the-perms-command"&gt;The “perms” Command&lt;/h2&gt; &lt;p&gt;The perms function accepts a list of items, and returns all possible orderings of these items. You may remember this from high school as a permutation problem. Here’s a simple example:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;perms&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;This function is simple enough, but spares one managing the loops this would otherwise require. One nice thing about perms is that it will accepts non-numeric data as cell array lists:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;perms&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;     &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt; &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;     &lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;     &lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt; &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'red'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'blue'&lt;/span&gt;     &lt;span style="color: rgb(160, 32, 240);"&gt;'green'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;This function might be useful in resource assignment problems, such as assigning sports teams their preferences of players, fields, etc., with teams selecting in the indicated order. Each time this round of selections takes place, the next row would be used.&lt;br /&gt;&lt;span id="more-145"&gt;&lt;/span&gt;&lt;/p&gt; &lt;h2 id="toc-the-randperm-command"&gt;The “randperm” Command&lt;/h2&gt; &lt;p&gt;Many problems require the shuffling of a list of items. This comes up in randomizing the order of examples for machine learning systems, shuffing virtual cards in game programs and simulations. This can be accomplised using MATLAB’s widely used rand and sort functions:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; MyList = &lt;span style="color: rgb(0, 136, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;]&lt;/span&gt;'&lt;br /&gt;&lt;br /&gt;MyList =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;   &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 136, 0);"&gt;[&lt;/span&gt;R Index&lt;span style="color: rgb(0, 136, 0);"&gt;]&lt;/span&gt; = &lt;span style="color: rgb(0, 0, 255);"&gt;sort&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;rand&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;,&lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;R =&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;0.1419&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;0.4218&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;0.4854&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;0.8003&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;0.9157&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;0.9572&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Index =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;   &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; MyList = MyList&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;Index&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;cle&lt;br /&gt;&lt;br /&gt;MyList =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;This is all unnecessarily complex, though, since randperm will do this in a single step:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; MyList = &lt;span style="color: rgb(0, 136, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;]&lt;/span&gt;'&lt;br /&gt;&lt;br /&gt;MyList =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt; MyList = MyList&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;randperm&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;MyList =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;randperm(n) returns the integers from 1 to n, in a random order:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;randperm&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;8&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;8&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;7&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Note that randperm is driven by the same random number generator that feeds rand, so calling one will affect the subsequent output of the other, and both are seeded the same way.&lt;/p&gt; &lt;h2 id="toc-the-nchoosek-command"&gt;The “nchoosek” Command&lt;/h2&gt; &lt;p&gt;Pop quiz! How many ways are there to draw a hand of 5 cards from a deck of 52 cards, ignoring their order? I don’t remember how to calculate this either, but the nchoosek function will do it for you, and more!&lt;/p&gt; &lt;p&gt;When given scalar arguments, nchoosek(n,k) will return the number of combinations of n items, taken k at a time. For instance, if one needed to know how many ways 2 things could be drawn from a set of 6:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;nchoosek&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;,&lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt;15&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Sometimes, though, what is needed is a list of the actual combinations. With a vector for its first argument, nchoosek will return all possible combinations:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;nchoosek&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;:&lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;,&lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;1&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;3&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;4&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;6&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;As with perms, this saves potentially much looping and other headaches for the MATLAB programmer. Also like perms, nchoosek will accept a cell array of strings as the list of items:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;nchoosek&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(160, 32, 240);"&gt;'chicken'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'fish'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'pizza'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'beef'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'soup'&lt;/span&gt;, &lt;span style="color: rgb(160, 32, 240);"&gt;'ratatouille'&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;}&lt;/span&gt;,&lt;span style="color: rgb(51, 51, 255);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'chicken'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'fish'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'chicken'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'pizza'&lt;/span&gt;     &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'chicken'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'beef'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'chicken'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'soup'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'chicken'&lt;/span&gt;    &lt;span style="color: rgb(160, 32, 240);"&gt;'ratatouille'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'fish'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'pizza'&lt;/span&gt;     &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'fish'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'beef'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'fish'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'soup'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'fish'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'ratatouille'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'pizza'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'beef'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'pizza'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'soup'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'pizza'&lt;/span&gt;      &lt;span style="color: rgb(160, 32, 240);"&gt;'ratatouille'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'beef'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'soup'&lt;/span&gt;      &lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'beef'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'ratatouille'&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(160, 32, 240);"&gt;'soup'&lt;/span&gt;       &lt;span style="color: rgb(160, 32, 240);"&gt;'ratatouille'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Incidentally, there are over two and a half million distinct 5-card hands from a deck of 52:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="matlab"&gt;&gt;&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;nchoosek&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;52&lt;/span&gt;,&lt;span style="color: rgb(51, 51, 255);"&gt;5&lt;/span&gt;&lt;span style="color: rgb(0, 136, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ans&lt;/span&gt; =&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: rgb(51, 51, 255);"&gt;2598960&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;h2 id="toc-closing-thoughts"&gt;Closing Thoughts&lt;/h2&gt; &lt;p&gt;Take care not to apply perms and nchoosek to calculations which are too large: the number of theoretically possible combinations or permutations can grow quite large.&lt;/p&gt; &lt;p&gt;It is often helpful to be familiar with parts of MATLAB which you may use less frequently. My recommendation is to occasionally glance through the help facility. Calling help by itself yields a list of sub-topics, such as elfun (elementary math), graph3d (”three dimensional graphs”) and strfun (”character strings”). Accessing help for any of these provides a list of functions which you should explore for future use.&lt;/p&gt; &lt;h2 id="toc-about-the-author"&gt;About the Author&lt;/h2&gt; &lt;p&gt;Will Dwinnell is a senior-level data miner who writes the &lt;a href="http://matlabdatamining.blogspot.com/"&gt;Data Mining in MATLAB Web log&lt;/a&gt;.  We suggest you visit his site and see what he has to offer.  There are some very interesting articles there!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-1578409284342547545?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/1578409284342547545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=1578409284342547545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/1578409284342547545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/1578409284342547545'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/08/matlab-introduction-to-combinatorics.html' title='Matlab - An Introduction to Combinatorics'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-2993898704192220362</id><published>2008-08-11T08:18:00.001-07:00</published><updated>2008-08-11T08:20:07.181-07:00</updated><title type='text'>在matlab中如何控制数据的输出格式？（完整总结）</title><content type='html'>&lt;span style="font-size:130%;"&gt;在matlab中如何控制数据的输出格式？（完整总结）&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;format&lt;br /&gt;缺省时为默认短格式方式与format short相同&lt;br /&gt;&lt;br /&gt;format short&lt;br /&gt;短格式方式，显示5位定点十进制数。&lt;br /&gt;&lt;br /&gt;format long&lt;br /&gt;长格式方式，显示15位定点十进制数。&lt;br /&gt;&lt;br /&gt;format short g&lt;br /&gt;当数据大于1000或小于1时便会以科学记数法显示（-e），若想坚持用整数部分加小数部分的格式来显示，就要再后边加 g&lt;br /&gt;&lt;br /&gt;format long g&lt;br /&gt;&lt;br /&gt;format hex&lt;br /&gt;十六进制格式方式。&lt;br /&gt;&lt;br /&gt;format bank&lt;br /&gt;银行格式。按元、角、分（小数点后具有两位）的固定格式。&lt;br /&gt;&lt;br /&gt;format +&lt;br /&gt;+格式，以＋，—和空格分别表示中的正数，负数和零元素&lt;br /&gt;&lt;br /&gt;format short  e&lt;br /&gt;短格式e方式，显示5位浮点十进制数&lt;br /&gt;&lt;br /&gt;format long   e&lt;br /&gt;长格式e方式，显示15位浮点十进制数。&lt;br /&gt;&lt;br /&gt;format rat&lt;br /&gt;分数格式形式。用有理数逼近显示数据。如pi显示为355/113。&lt;br /&gt;&lt;br /&gt;format loose&lt;br /&gt;松散格式。数据之间有空行。&lt;br /&gt;&lt;br /&gt;format compact&lt;br /&gt;紧凑格式。数据之间无空行。&lt;br /&gt;&lt;br /&gt;vpa(date,n)&lt;br /&gt;将数据date以n位有效数字显示。&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-2993898704192220362?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/2993898704192220362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=2993898704192220362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2993898704192220362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2993898704192220362'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2008/08/matlab.html' title='在matlab中如何控制数据的输出格式？（完整总结）'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4720818831312175029</id><published>2007-11-24T19:32:00.001-08:00</published><updated>2007-11-24T19:32:59.762-08:00</updated><title type='text'>makeresampler</title><content type='html'>&gt;&gt; help makeresampler&lt;br /&gt; MAKERESAMPLER Create resampling structure.&lt;br /&gt;    R = MAKERESAMPLER(INTERPOLANT,PADMETHOD) creates a separable&lt;br /&gt;    resampler structure for use with TFORMARRAY and IMTRANSFORM.&lt;br /&gt;    In its simplest form, INTERPOLANT can be one of these strings:&lt;br /&gt;    'nearest', 'linear', or 'cubic'.  INTERPOLANT specifies the&lt;br /&gt;    interpolating kernel that the separable resampler uses.  PADMETHOD&lt;br /&gt;    can be one of these strings: 'replicate', 'symmetric', 'circular',&lt;br /&gt;    'fill', or 'bound'.  PADMETHOD controls how the resampler to&lt;br /&gt;    interpolates or assigns values to output elements that map close&lt;br /&gt;    to or outside the edge of input array.&lt;br /&gt; &lt;br /&gt;    PADMETHOD options&lt;br /&gt;    -----------------&lt;br /&gt;    In the case of 'fill', 'replicate', 'circular', or 'symmetric',&lt;br /&gt;    the resampling performed by TFORMARRAY or IMTRANSFORM occurs in&lt;br /&gt;    two logical steps: (1) pad A infinitely to fill the entire input&lt;br /&gt;    transform space, then (2) evaluate the convolution of the padded&lt;br /&gt;    A with the resampling kernel at the output points specified by&lt;br /&gt;    the geometric map.  Each non-transform dimension is handled&lt;br /&gt;    separately.  The padding is virtual, (accomplished by remapping&lt;br /&gt;    array subscripts) for performance and memory efficiency.&lt;br /&gt;   &lt;br /&gt;    'circular', 'replicate', and 'symmetric' have the same meanings as&lt;br /&gt;    in PADARRAY as applied to the transform dimensions of A:&lt;br /&gt;    &lt;br /&gt;      'replicate' -- Repeats the outermost elements&lt;br /&gt;      'circular'  -- Repeats A circularly&lt;br /&gt;      'symmetric' -- Mirrors A repeatedly.&lt;br /&gt;    &lt;br /&gt;    'fill' generates an output array with smooth-looking edges (except&lt;br /&gt;    when using nearest neighbor interpolation) because for output points&lt;br /&gt;    that map near the edge of the input array (either inside or outside),&lt;br /&gt;    it combines input image and fill values .&lt;br /&gt;   &lt;br /&gt;    'bound' is like 'fill', but avoids mixing fill values and input image&lt;br /&gt;    values.  Points that map outside are assigned values from the fill&lt;br /&gt;    value array.  Points that map inside are treated as with 'replicate'. &lt;br /&gt;    'bound' and 'fill' produce identical results when INTERPOLANT is&lt;br /&gt;    'nearest'.&lt;br /&gt;  &lt;br /&gt;    It is up to the user to implement these behaviors in the case of a&lt;br /&gt;    custom resampler.&lt;br /&gt;  &lt;br /&gt;    Advanced options for INTERPOLANT&lt;br /&gt;    --------------------------------&lt;br /&gt;    In general, INTERPOLANT can have one of these forms:&lt;br /&gt; &lt;br /&gt;        1. One of these strings: 'nearest', 'linear', 'cubic'&lt;br /&gt; &lt;br /&gt;        2. A cell array: {HALF_WIDTH, POSITIVE_HALF}&lt;br /&gt;           HALF_WIDTH is a positive scalar designating the half width of&lt;br /&gt;           a symmetric interpolating kernel.  POSITIVE_HALF is a vector&lt;br /&gt;           of values regularly sampling the kernel on the closed interval&lt;br /&gt;           [0 POSITIVE_HALF].&lt;br /&gt; &lt;br /&gt;        3. A cell array: {HALF_WIDTH, INTERP_FCN}&lt;br /&gt;           INTERP_FCN is a function handle that returns interpolating&lt;br /&gt;           kernel values given an array of input values in the interval &lt;br /&gt;           [0 POSITIVE_HALF].&lt;br /&gt; &lt;br /&gt;        4. A cell array whose elements are one of the three forms above.&lt;br /&gt; &lt;br /&gt;    Forms 2 and 3 are used to interpolate with a custom interpolating&lt;br /&gt;    kernel.  Form 4 is used to specify the interpolation method&lt;br /&gt;    independently along each dimension.  The number of elements in the&lt;br /&gt;    cell array for form 4 must equal the number of transform dimensions.&lt;br /&gt;    For example, if INTERPOLANT is {'nearest', 'linear', {2&lt;br /&gt;    KERNEL_TABLE}}, then the resampler will use nearest-neighbor&lt;br /&gt;    interpolation along the first transform dimension, linear&lt;br /&gt;    interpolation along the second, and a custom table-based&lt;br /&gt;    interpolation along the third.&lt;br /&gt; &lt;br /&gt;    Custom resamplers&lt;br /&gt;    -----------------&lt;br /&gt;    The syntaxes described above construct a resampler structure that&lt;br /&gt;    uses the separable resampler function that ships with the Image&lt;br /&gt;    Processing Toolbox.  It is also possible to create a resampler&lt;br /&gt;    structure that uses a user-written resampler by using this syntax: &lt;br /&gt;    R = MAKERESAMPLER(PropertyName,PropertyValue,...).  PropertyName can&lt;br /&gt;    be 'Type', 'PadMethod', 'Interpolant', 'NDims', 'ResampleFcn', or&lt;br /&gt;    'CustomData'.&lt;br /&gt; &lt;br /&gt;    'Type' can be either 'separable' or 'custom' and must always be&lt;br /&gt;    supplied.  If 'Type' is 'separable', the only other properties that can&lt;br /&gt;    be specified are 'Interpolant' and 'PadMethod', and the result is&lt;br /&gt;    equivalent to using the MAKERESAMPLER(INTERPOLANT,PADMETHOD) syntax.&lt;br /&gt;    If 'Type' is 'custom', then 'NDims' and 'ResampleFcn' are required&lt;br /&gt;    properties, and 'CustomData' is optional.  'NDims' is a positive&lt;br /&gt;    integer and indicates what dimensionality the custom resampler can&lt;br /&gt;    handle.  Use a value of Inf to indicate that the custom resampler can&lt;br /&gt;    handle any dimension.  The value of 'CustomData' is unconstrained.&lt;br /&gt; &lt;br /&gt;    'ResampleFcn' is a handle to a function that performs the resampling.&lt;br /&gt;    The function will be called with the following interface:&lt;br /&gt; &lt;br /&gt;        B = RESAMPLE_FCN(A,M,TDIMS_A,TDIMS_B,FSIZE_A,FSIZE_B,F,R)&lt;br /&gt; &lt;br /&gt;    See the help for TFORMARRAY for information on the inputs A, TDIMS_A,&lt;br /&gt;    TDIMS_B, and F.&lt;br /&gt; &lt;br /&gt;    M is an array that maps the transform subscript space of B to the&lt;br /&gt;    transform subscript space of A.  If A has N transform dimensions (N =&lt;br /&gt;    length(TDIMS_A)) and B has P transform dimensions (P = length(TDIMS_B)),&lt;br /&gt;    then NDIMS(M) = P + 1 if N &gt; 1 and P if N == 1, and SIZE(M, P + 1) =&lt;br /&gt;    N.  The first P dimensions of M correspond to the output transform&lt;br /&gt;    space, permuted according to the order in which the output transform&lt;br /&gt;    dimensions are listed in TDIMS_B.  (In general TDIMS_A and TDIMS_B need &lt;br /&gt;    not be sorted in ascending order, although such a limitation may be &lt;br /&gt;    imposed by specific resamplers.)  Thus the first P elements of SIZE(M) &lt;br /&gt;    determine the sizes of the transform dimensions of B.  The input &lt;br /&gt;    transform coordinates to which each point is mapped are arrayed across &lt;br /&gt;    the final dimension of M, following the order given in TDIMS_A.  M must &lt;br /&gt;    be double.&lt;br /&gt; &lt;br /&gt;    FSIZE_A and FSIZE_B are the full sizes of A and B, padded with 1s as&lt;br /&gt;    necessary to be consistent with TDIMS_A, TDIMS_B, and SIZE(A).&lt;br /&gt; &lt;br /&gt;    Example&lt;br /&gt;    -------&lt;br /&gt;    Stretch an image in the y-direction using separable resampler that&lt;br /&gt;    applies in cubic interpolation in the y-direction and nearest&lt;br /&gt;    neighbor interpolation in the x-direction. (This is equivalent to,&lt;br /&gt;    but faster than, applying bicubic interpolation.)&lt;br /&gt; &lt;br /&gt;        A = imread('moon.tif');&lt;br /&gt;        resamp = makeresampler({'nearest','cubic'},'fill');&lt;br /&gt;        stretch = maketform('affine',[1 0; 0 1.3; 0 0]);&lt;br /&gt;        B = imtransform(A,stretch,resamp);&lt;br /&gt; &lt;br /&gt;    See also imtransform, tformarray.&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc makeresampler&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4720818831312175029?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4720818831312175029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4720818831312175029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4720818831312175029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4720818831312175029'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/11/makeresampler.html' title='makeresampler'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-2180246867898151697</id><published>2007-11-24T13:34:00.000-08:00</published><updated>2007-11-24T13:35:07.397-08:00</updated><title type='text'>A very important function of spatial transformation</title><content type='html'>&gt;&gt;help findbounds&lt;br /&gt; &lt;br /&gt;FINDBOUNDS Find output bounds for spatial transformation.&lt;br /&gt;    OUTBOUNDS = FINDBOUNDS(TFORM,INBOUNDS) estimates the output bounds&lt;br /&gt;    corresponding to a given spatial transformation and a set of input&lt;br /&gt;    bounds.  TFORM is a spatial transformation structure as returned by&lt;br /&gt;    MAKETFORM or CP2TFORM.  INBOUNDS is 2-by-NUM_DIMS matrix.  The first row&lt;br /&gt;    of INBOUNDS specifies the lower bounds for each dimension, and the&lt;br /&gt;    second row specifies the upper bounds. NUM_DIMS has to be consistent&lt;br /&gt;    with the ndims_in field of TFORM.&lt;br /&gt; &lt;br /&gt;    OUTBOUNDS has the same form as INBOUNDS.  It is an estimate of the&lt;br /&gt;    smallest rectangular region completely containing the transformed&lt;br /&gt;    rectangle represented by the input bounds.  Since OUTBOUNDS is only an&lt;br /&gt;    estimate, it may not completely contain the transformed input rectangle.&lt;br /&gt; &lt;br /&gt;    Notes&lt;br /&gt;    -----&lt;br /&gt;    IMTRANSFORM uses FINDBOUNDS to compute the 'OutputBounds' parameter&lt;br /&gt;    if the user does not provide it.&lt;br /&gt; &lt;br /&gt;    If TFORM contains a forward transformation (a nonempty forward_fcn&lt;br /&gt;    field), then FINDBOUNDS works by transforming the vertices of the input&lt;br /&gt;    bounds rectangle and then taking minimum and maximum values of the&lt;br /&gt;    result.&lt;br /&gt; &lt;br /&gt;    If TFORM does not contain a forward transformation, then FINDBOUNDS&lt;br /&gt;    estimates the output bounds using the Nelder-Mead optimization&lt;br /&gt;    function FMINSEARCH.  If the optimization procedure fails, FINDBOUNDS&lt;br /&gt;    issues a warning and returns OUTBOUNDS=INBOUNDS.&lt;br /&gt; &lt;br /&gt;    Example&lt;br /&gt;    -------&lt;br /&gt;        inbounds = [0 0; 1 1]&lt;br /&gt;        tform = maketform('affine',[2 0 0; .5 3 0; 0 0 1])&lt;br /&gt;        outbounds = findbounds(tform, inbounds)&lt;br /&gt; &lt;br /&gt;    See also cp2tform, imtransform, maketform, tformarray, tformfwd, tforminv.&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc findbounds&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-2180246867898151697?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/2180246867898151697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=2180246867898151697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2180246867898151697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2180246867898151697'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/11/very-important-function-of-spatial.html' title='A very important function of spatial transformation'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-1383902679072923791</id><published>2007-11-23T17:28:00.000-08:00</published><updated>2007-11-23T17:49:53.179-08:00</updated><title type='text'>2d homography 终于成功</title><content type='html'>对于同一图景的两张图片,如果摄取的相机的光心发生变化,则对于这两张图片并不存在一个homography去建立两者的变换. 但是,如果所摄取的途径近似在同一个平面上,则这个变换是存在的(情形1).&lt;br /&gt;&lt;br /&gt;另外一种情形,如果光心不变,相机在这种情况下对于任何图景拍摄一系列图片,则图片间的homography是存在的,利用这种办法可以建立panorama(情形2).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MVG这本书上面提供了一个例子,通过四个点对,建立一堵墙的两个图像之间的变换关系,这个题目基本跟matlab提供的遥感图像很类似，但是我试了好几次，结果就是不对，其原因现在已经查明，1 四对点精度不够，用18对点效果很好 2 根据四对点计算的2d homography，我自己的解好像是错误的。matlab&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-1383902679072923791?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/1383902679072923791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=1383902679072923791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/1383902679072923791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/1383902679072923791'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/11/2d-homography.html' title='2d homography 终于成功'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-9054355058031300818</id><published>2007-11-23T15:47:00.001-08:00</published><updated>2007-11-23T17:28:09.094-08:00</updated><title type='text'>Registering an Aerial Photo to an Orthophoto</title><content type='html'>http://www.mathworks.com/products/demos/shipping/images/ipexaerial.html?product=IP&lt;br /&gt;&lt;br /&gt;Registering an Aerial Photo to an Orthophoto&lt;br /&gt;&lt;br /&gt;Two images of the same scene can only be compared directly if they are in the same coordinate system. Image registration is the process of transforming one image into the coordinate system of another image. &lt;br /&gt;&lt;br /&gt;=============&lt;br /&gt;&lt;br /&gt;Step 1: Read Images&lt;br /&gt;&lt;br /&gt;The image westconcordorthophoto.png is an orthophoto that has already been registered to the ground. The image westconcordaerial.png is unregistered as it was taken from an airplane and is distorted relative to the orthophoto.&lt;br /&gt;&lt;br /&gt;unregistered = imread('westconcordaerial.png');&lt;br /&gt;figure, imshow(unregistered)&lt;br /&gt;text(size(unregistered,2),size(unregistered,1)+15, ...&lt;br /&gt;    'Image courtesy of mPower3/Emerge', ...&lt;br /&gt;    'FontSize',7,'HorizontalAlignment','right');&lt;br /&gt;&lt;br /&gt;注意:&lt;br /&gt;由于在matlab中有两套坐标系统，所以要注意不要混淆，参见Image Processing Toolbox pp2-37&lt;br /&gt;简单的说，对于pixel coordinate system (r,c) r--向下为增加 c--向右为增加&lt;br /&gt;对于 spatial coordinate system (x,y) x--向右为增加, y--向下为增加&lt;br /&gt;&lt;br /&gt;|--------c 第二坐标&lt;br /&gt;|&lt;br /&gt;|&lt;br /&gt;|&lt;br /&gt;|r 第一坐标&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;|--------x 第一坐标&lt;br /&gt;|&lt;br /&gt;|&lt;br /&gt;|&lt;br /&gt;|y 第二坐标&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;text(size(unregistered,2),size(unregistered,1)+15, ...&lt;br /&gt;这句话使得pixel coordinate system 转换到spatial coordinate system，即在图片右下角偏下15个坐标单位的地方写上一条注释。由于HorizontalAlignment被选择为right，所以这条注释的最后一个字出现在这个坐标的位置上。为理解它，不妨试试下面的两条命令的效果&lt;br /&gt;&gt;&gt; text(size(unregistered,2),size(unregistered,1)+15, ...&lt;br /&gt;    'Image courtesy of mPower3/Emerge', ...&lt;br /&gt;    'FontSize',7,'HorizontalAlignment','left');&lt;br /&gt;&lt;br /&gt;&gt;&gt; text(size(unregistered,2),size(unregistered,1)+15, ...&lt;br /&gt;    'Image courtesy of mPower3/Emerge', ...&lt;br /&gt;    'FontSize',7,'HorizontalAlignment','center');&lt;br /&gt;这样一来,我们对这段代码就有了透辟的理解.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;registeredOriginal = imread('westconcordorthophoto.png');&lt;br /&gt;figure, imshow(registeredOriginal)&lt;br /&gt;text(size(registeredOriginal,2),size(registeredOriginal,1)+15, ...&lt;br /&gt;    'Image courtesy of Massachusetts Executive Office of Environmental Affairs', ...&lt;br /&gt;    'FontSize',7,'HorizontalAlignment','right');&lt;br /&gt;&lt;br /&gt;这段代码无需解释,是以完全同样的方式打开另外一幅图像.&lt;br /&gt;&lt;br /&gt;===========&lt;br /&gt;&lt;br /&gt;Step 2: Load and Add Control Points&lt;br /&gt;&lt;br /&gt;Four pairs of control points have already been picked. Load these points from a MAT-file. If you want to proceed with these points, go to Step 3: Infer Geometric Transformation.&lt;br /&gt;&lt;br /&gt;load westconcordpoints&lt;br /&gt;&lt;br /&gt;Optionally, edit or add to the pre-picked points using the Control Point Selection Tool (cpselect). cpselect helps you pick pairs of corresponding control points. Control points are landmarks that you can find in both images, like a road intersection, or a natural feature. The unregistered image is an RGB image but cpselect only takes grayscale images, so you will pass it one plane of the RGB image.&lt;br /&gt;&lt;br /&gt;cpselect(unregistered(:,:,1),'westconcordorthophoto.png',...&lt;br /&gt;         input_points,base_points)&lt;br /&gt;&lt;br /&gt;Save control points by choosing the File menu, then the Save Points to Workspace option. Save the points, overwriting variables input_points and base_points. &lt;br /&gt;&lt;br /&gt;利用工具,选择对应点,已经选好四对.&lt;br /&gt;顺便说一句,cpselect中cp的意思是control point.&lt;br /&gt;&lt;br /&gt;========&lt;br /&gt;四个非特殊位置的点决定一个projective变换,下面就利用我们选就的四对点来求出这个变换。&lt;br /&gt;&lt;br /&gt;Step 3: Infer Geometric Transformation&lt;br /&gt;&lt;br /&gt;Because we know that the unregistered image was taken from an airplane, and the topography is relatively flat, it is likely that most of the distortion is projective. cp2tform will find the parameters of the projective distortion that best fits the stray input_points and base_points you picked.&lt;br /&gt;&lt;br /&gt;t_concord = cp2tform(input_points,base_points,'projective');&lt;br /&gt;&lt;br /&gt;顺便指出,利用&lt;br /&gt;&gt;&gt;t_concord.tdata.T&lt;br /&gt;，可以得到&lt;br /&gt;&lt;br /&gt;ans =&lt;br /&gt;&lt;br /&gt;    0.9109    0.1412   -0.0001&lt;br /&gt;   -0.1323    0.8718    0.0001&lt;br /&gt;   65.8746   13.5141    0.9955&lt;br /&gt;这就是依赖这四对点,求出的变换关系.&lt;br /&gt;&lt;br /&gt;========&lt;br /&gt;&lt;br /&gt;Step 4: Transform Unregistered Image&lt;br /&gt;&lt;br /&gt;Even though the points were picked on one plane of the unregistered image, you can transform the entire RGB image. imtransform will apply the same transformation to each plane. Note that the choice of 'XData' and 'YData' values ensures the registered image will be aligned with the orthophoto.&lt;br /&gt;&lt;br /&gt;info = imfinfo('westconcordorthophoto.png');&lt;br /&gt;registered = imtransform(unregistered,t_concord,...&lt;br /&gt;                         'XData',[1 info.Width], 'YData',[1 info.Height]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;=============&lt;br /&gt;&lt;br /&gt;Step 5: View Registered Image&lt;br /&gt;&lt;br /&gt;figure, imshow(registered)&lt;br /&gt;&lt;br /&gt;Compare this visually to the orthophoto and to the unregistered image. Try going back to Step 2: Choose Control Points and using more than four pairs of points. Are the results better? What if the points are clumped together?&lt;br /&gt;&lt;br /&gt;If you want to experiment with larger images, follow the steps above to register concordaerial.png to concordorthophoto.png.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-9054355058031300818?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/9054355058031300818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=9054355058031300818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/9054355058031300818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/9054355058031300818'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/11/registering-aerial-photo-to-orthophoto.html' title='Registering an Aerial Photo to an Orthophoto'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-2410751740545898149</id><published>2007-11-21T08:07:00.001-08:00</published><updated>2007-11-21T08:13:06.726-08:00</updated><title type='text'>Performing General 2-D Spatial Transformations</title><content type='html'>http://www.mathworks.com/access/helpdesk/help/toolbox/images/index.html?/access/helpdesk/help/toolbox/images/f12-26140.html&lt;br /&gt;&lt;br /&gt;不共线三点决定一个affine homography&lt;br /&gt;任意三点不共线四点决定一个projective homography&lt;br /&gt;help maketform&lt;br /&gt;  MAKETFORM Create spatial transformation structure (TFORM).  &lt;br /&gt;    T = MAKETFORM(TRANSFORMTYPE,...) creates a multidimensional spatial&lt;br /&gt;    transformation structure (a 'TFORM struct') that can be used with&lt;br /&gt;    TFORMFWD, TFORMINV, FLIPTFORM, IMTRANSFORM, or TFORMARRAY.&lt;br /&gt;    TRANSFORMTYPE can be 'affine', 'projective', 'custom', 'box', or&lt;br /&gt;    'composite'. Spatial transformations are also called geometric&lt;br /&gt;    transformations.&lt;br /&gt; &lt;br /&gt;    T = MAKETFORM('affine',A) builds a TFORM struct for an N-dimensional&lt;br /&gt;    affine transformation.  A is a nonsingular real (N+1)-by-(N+1) or&lt;br /&gt;    (N+1)-by-N matrix.  If A is (N+1)-by-(N+1), then the last column&lt;br /&gt;    of A must be [zeros(N,1); 1].  Otherwise, A is augmented automatically&lt;br /&gt;    such that its last column is [zeros(N,1); 1].  A defines a forward&lt;br /&gt;    transformation such that TFORMFWD(U,T), where U is a 1-by-N vector,&lt;br /&gt;    returns a 1-by-N vector X such that X = U * A(1:N,1:N) + A(N+1,1:N).&lt;br /&gt;    T has both forward and inverse transformations.&lt;br /&gt; &lt;br /&gt;    T = MAKETFORM('projective',A) builds a TFORM struct for an N-dimensional&lt;br /&gt;    projective transformation.  A is a nonsingular real (N+1)-by-(N+1)&lt;br /&gt;    matrix.  A(N+1,N+1) cannot be 0.  A defines a forward transformation&lt;br /&gt;    such that TFORMFWD(U,T), where U is a 1-by-N vector, returns a 1-by-N&lt;br /&gt;    vector X such that X = W(1:N)/W(N+1), where W = [U 1] * A.  T has&lt;br /&gt;    both forward and inverse transformations.&lt;br /&gt;    &lt;br /&gt;    T = MAKETFORM('affine',U,X) builds a TFORM struct for a&lt;br /&gt;    two-dimensional affine transformation that maps each row of U&lt;br /&gt;    to the corresponding row of X.  U and X are each 3-by-2 and&lt;br /&gt;    define the corners of input and output triangles.  The corners&lt;br /&gt;    may not be collinear.&lt;br /&gt; &lt;br /&gt;    T = MAKETFORM('projective',U,X) builds a TFORM struct for a&lt;br /&gt;    two-dimensional projective transformation that maps each row of U&lt;br /&gt;    to the corresponding row of X.  U and X are each 4-by-2 and&lt;br /&gt;    define the corners of input and output quadrilaterals.  No three&lt;br /&gt;    corners may be collinear.&lt;br /&gt; &lt;br /&gt;    T = MAKETFORM('custom',NDIMS_IN,NDIMS_OUT,FORWARD_FCN,INVERSE_FCN,&lt;br /&gt;    TDATA) builds a custom TFORM struct based on user-provided function&lt;br /&gt;    handles and parameters.  NDIMS_IN and NDIMS_OUT are the numbers of&lt;br /&gt;    input and output dimensions.  FORWARD_FCN and INVERSE_FCN are&lt;br /&gt;    function handles to forward and inverse functions.  Those functions&lt;br /&gt;    must support the syntaxes X = FORWARD_FCN(U,T) and U =&lt;br /&gt;    INVERSE_FCN(X,T), where U is a P-by-NDIMS_IN matrix whose rows are&lt;br /&gt;    points in the transformation's input space, and X is a&lt;br /&gt;    P-by-NDIMS_OUT matrix whose rows are points in the transformation's&lt;br /&gt;    output space.  TDATA can be any MATLAB array and is typically used to&lt;br /&gt;    store parameters of the custom transformation.  It is accessible to&lt;br /&gt;    FORWARD_FCN and INVERSE_FNC via the "tdata" field of T.  Either&lt;br /&gt;    FORWARD_FCN or INVERSE_FCN can be empty, although at least&lt;br /&gt;    INVERSE_FCN must be defined to use T with TFORMARRAY or IMTRANSFORM.&lt;br /&gt; &lt;br /&gt;    T = MAKETFORM('composite',T1,T2,...,TL) or T = MAKETFORM('composite',&lt;br /&gt;    [T1 T2 ... TL]) builds a TFORM whose forward and inverse functions&lt;br /&gt;    are the functional compositions of the forward and inverse functions&lt;br /&gt;    of the T1, T2, ..., TL.  For example, if L = 3 then TFORMFWD(U,T) is&lt;br /&gt;    the same as TFORMFWD(TFORMFWD(TFORMFWD(U,T3),T2),T1).  The components&lt;br /&gt;    T1 through TL must be compatible in terms of the numbers of input and&lt;br /&gt;    output dimensions.  T has a defined forward transform function only&lt;br /&gt;    if all of the component transforms have defined forward transform&lt;br /&gt;    functions.  T has a defined inverse transform function only if all of&lt;br /&gt;    the component functions have defined inverse transform functions.&lt;br /&gt; &lt;br /&gt;    T = MAKETFORM('box',TSIZE,LOW,HIGH) or T = MAKETFORM('box',INBOUNDS,&lt;br /&gt;    OUTBOUNDS) builds an N-dimensional affine TFORM struct, T.  TSIZE is&lt;br /&gt;    an N-element vector of positive integers, and LOW and HIGH are also&lt;br /&gt;    N-element vectors.  The transformation maps an input "box" defined&lt;br /&gt;    by the opposite corners ONES(1,N) and TSIZE or, alternatively, by&lt;br /&gt;    corners INBOUNDS(1,:) and INBOUND(2,:) to an output box defined by&lt;br /&gt;    the opposite corners LOW and HIGH or OUTBOUNDS(1,:) and OUTBOUNDS(2,:).&lt;br /&gt;    LOW(K) and HIGH(K) must be different unless TSIZE(K) is 1, in which&lt;br /&gt;    case the affine scale factor along the K-th dimension is assumed to be&lt;br /&gt;    1.0.  Similarly, INBOUNDS(1,K) and INBOUNDS(2,K) must be different&lt;br /&gt;    unless OUTBOUNDS(1,K) and OUTBOUNDS(1,K) are the same, and vice versa.&lt;br /&gt;    The 'box' TFORM is typically used to register the row and column&lt;br /&gt;    subscripts of an image or array to some "world" coordinate system.&lt;br /&gt; &lt;br /&gt;    Example&lt;br /&gt;    -------&lt;br /&gt;    Make and apply an affine transformation.&lt;br /&gt; &lt;br /&gt;        T = maketform('affine',[.5 0 0; .5 2 0; 0 0 1]);&lt;br /&gt;        tformfwd([10 20],T);&lt;br /&gt;        I = imread('cameraman.tif');&lt;br /&gt;        transformedI = imtransform(I,T);&lt;br /&gt;        figure, imshow(I), figure, imshow(transformedI)&lt;br /&gt; &lt;br /&gt;    See also fliptform, imtransform, tformarray, tformfwd, tforminv.&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc maketform&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-2410751740545898149?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/2410751740545898149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=2410751740545898149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2410751740545898149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/2410751740545898149'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/11/performing-general-2-d-spatial.html' title='Performing General 2-D Spatial Transformations'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-7486059328015099427</id><published>2007-11-19T16:53:00.000-08:00</published><updated>2007-11-19T16:54:35.888-08:00</updated><title type='text'>Windows快捷键大全</title><content type='html'>Windows快捷键大全&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;一、常见用法：&lt;br /&gt;&lt;br /&gt;F1　　　　　　　　　　　显示当前程序或者windows的帮助内容。&lt;br /&gt;F2　　　　　　　　　　　当你选中一个文件的话，这意味着“重命名”&lt;br /&gt;F3　　　　　　　　　　　当你在桌面上的时候是打开“查找：所有文件” 对话框&lt;br /&gt;F10或ALT　　　　　　　　激活当前程序的菜单栏&lt;br /&gt;windows键或CTRL+ESC　　 打开开始菜单&lt;br /&gt;CTRL+ALT+DELETE　　　　 在win9x中打开关闭程序对话框&lt;br /&gt;DELETE　　　　　　　　　删除被选择的选择项目，如果是文件，将被放入回收站&lt;br /&gt;SHIFT+DELETE　　　　　　删除被选择的选择项目，如果是文件，将被直接删除而不是放入回收站&lt;br /&gt;CTRL+N　　　　　　　　　新建一个新的文件&lt;br /&gt;CTRL+O　　　　　　　　　打开“打开文件”对话框&lt;br /&gt;CTRL+P　　　　　　　　　打开“打印”对话框&lt;br /&gt;CTRL+S　　　　　　　　　保存当前操作的文件&lt;br /&gt;CTRL+X　　　　　　　　　剪切被选择的项目到剪贴板&lt;br /&gt;CTRL+INSERT 或 CTRL+C　 复制被选择的项目到剪贴板&lt;br /&gt;SHIFT+INSERT 或 CTRL+V　粘贴剪贴板中的内容到当前位置&lt;br /&gt;ALT+BACKSPACE 或 CTRL+Z 撤销上一步的操作&lt;br /&gt;ALT+SHIFT+BACKSPACE　　 重做上一步怀废牟僮?br&gt;　&lt;br /&gt;Windows键+M　　　　　　 最小化所有被打开的窗口。&lt;br /&gt;Windows键+CTRL+M　　　　重新将恢复上一项操作前窗口的大小和位置&lt;br /&gt;Windows键+E　　　　　　 打开资源管理器&lt;br /&gt;Windows键+F　　　　　　 打开“查找：所有文件”对话框&lt;br /&gt;Windows键+R　　　　　　 打开“运行”对话框&lt;br /&gt;Windows键+BREAK　　　　 打开“系统属性”对话框&lt;br /&gt;Windows键+CTRL+F　　　　打开“查找：计算机”对话框&lt;br /&gt;SHIFT+F10或鼠标右击　　 打开当前活动项目的快捷菜单&lt;br /&gt;SHIFT　　　　　　　　　 在放入CD的时候按下不放，可以跳过自动播放CD。在打开word的时候按下不放&lt;br /&gt;&lt;br /&gt;，可以跳过自启动的宏&lt;br /&gt;　&lt;br /&gt;ALT+F4　　　　　　　　　关闭当前应用程序&lt;br /&gt;ALT+SPACEBAR　　　　　　打开程序最左上角的菜单&lt;br /&gt;ALT+TAB　　　　　　　　 切换当前程序&lt;br /&gt;ALT+ESC　　　　　　　　 切换当前程序&lt;br /&gt;ALT+ENTER　　　　　　　 将windows下运行的MSDOS窗口在窗口和全屏幕状态间切换&lt;br /&gt;PRINT SCREEN　　　　　　将当前屏幕以图象方式拷贝到剪贴板&lt;br /&gt;ALT+PRINT SCREEN　　　　将当前活动程序窗口以图象方式拷贝到剪贴板&lt;br /&gt;CTRL+F4　　　　　　　　 关闭当前应用程序中的当前文本（如word中）&lt;br /&gt;CTRL+F6　　　　　　　　 切换到当前应用程序中的下一个文本（加shift 可以跳到前一个窗口）&lt;br /&gt;&lt;br /&gt;在IE中：&lt;br /&gt;&lt;br /&gt;ALT+RIGHT ARROW　　　　 显示前一页（前进键）&lt;br /&gt;ALT+LEFT ARROW　　　　　显示后一页（后退键）&lt;br /&gt;CTRL+TAB　　　　　　　　在页面上的各框架中切换（加shift反向）&lt;br /&gt;F5　　　　　　　　　　　刷新&lt;br /&gt;CTRL+F5　　　　　　　　 强行刷新　　目的快捷键&lt;br /&gt;　　激活程序中的菜单栏 F10&lt;br /&gt;　　执行菜单上相应的命令 ALT+菜单上带下划线的字母　　关闭多文档界面程序中的当&lt;br /&gt;　　前窗口 CTRL+ F4&lt;br /&gt;　　关闭当前窗口或退出程序 ALT+ F4&lt;br /&gt;　　复制 CTRL+ C&lt;br /&gt;　　剪切 CTRL+ X&lt;br /&gt;　　删除 DELETE&lt;br /&gt;　　显示所选对话框项目的帮助 F1&lt;br /&gt;　　显示当前窗口的系统菜单 ALT+空格键&lt;br /&gt;　　显示所选项目的快捷菜单 SHIFT+ F10&lt;br /&gt;　　显示“开始”菜单 CTRL+ ESC&lt;br /&gt;　　显示多文档界面程序的系统&lt;br /&gt;　　菜单 ALT+连字号(-)&lt;br /&gt;　　粘贴 CTR L+ V&lt;br /&gt;　　切换到上次使用的窗口或者&lt;br /&gt;　　按住 ALT然后重复按TAB，&lt;br /&gt;　　切换到另一个窗口 ALT+ TAB&lt;br /&gt;　　撤消 CTRL+ Z&lt;br /&gt;二、使用“Windows资源管理器”的快捷键&lt;br /&gt;　　目的快捷键&lt;br /&gt;　　如果当前选择展开了,要折&lt;br /&gt;　　叠或者选择父文件夹左箭头&lt;br /&gt;　　折叠所选的文件夹 NUM LOCK+负号(-)&lt;br /&gt;　　如果当前选择折叠了，要展开&lt;br /&gt;　　或者选择第一个子文件夹右箭头&lt;br /&gt;　　展开当前选择下的所有文件夹 NUM LOCK+*&lt;br /&gt;　　展开所选的文件夹 NUM LOCK+加号(+)&lt;br /&gt;　　在左右窗格间切换 F6&lt;br /&gt;&lt;br /&gt;三、使用 WINDOWS键&lt;br /&gt;　　可使用 Microsoft自然键盘或含有 Windows徽标键的其他任何兼容键盘的以下快捷键。&lt;br /&gt;　　目的快捷键&lt;br /&gt;　　在任务栏上的按钮间循环 WINDOWS+ TAB&lt;br /&gt;　　显示“查找：所有文件” WINDOWS+ F&lt;br /&gt;　　显示“查找：计算机” CTRL+ WINDOWS+ F&lt;br /&gt;　　显示“帮助” WINDOWS+ F1&lt;br /&gt;　　显示“运行”命令 WINDOWS+ R&lt;br /&gt;　　显示“开始”菜单 WINDOWS&lt;br /&gt;　　显示“系统属性”对话框 WINDOWS+ BREAK&lt;br /&gt;　　显示“Windows资源管理器” WINDOWS+ E&lt;br /&gt;　　最小化或还原所有窗口 WINDOWS+ D&lt;br /&gt;　　撤消最小化所有窗口 SHIFT+ WINDOWS+ M&lt;br /&gt;四、使用“我的电脑”和“Windows资源管理器”的快捷键&lt;br /&gt;　　目的快捷键&lt;br /&gt;　　关闭所选文件夹及其所有父&lt;br /&gt;　　文件夹按住 SHIFT键再单击“关闭按钮（仅适用于“我的电脑”）&lt;br /&gt;　　向后移动到上一个视图 ALT+左箭头&lt;br /&gt;　　向前移动到上一个视图 ALT+右箭头&lt;br /&gt;　　查看上一级文件夹 BACKSPACE&lt;br /&gt;五、使用对话框中的快捷键&lt;br /&gt;　　目的快捷键&lt;br /&gt;　　取消当前任务 ESC&lt;br /&gt;　　如果当前控件是个按钮，要&lt;br /&gt;　　单击该按钮或者如果当前控&lt;br /&gt;　　件是个复选框，要选择或清&lt;br /&gt;　　除该复选框或者如果当前控&lt;br /&gt;　　件是个选项按钮，要单击该&lt;br /&gt;　　选项空格键&lt;br /&gt;　　单击相应的命令 ALT+带下划线的字母&lt;br /&gt;　　单击所选按钮 ENTER&lt;br /&gt;　　在选项上向后移动 SHIFT+ TAB&lt;br /&gt;　　在选项卡上向后移动 CTRL+ SHIFT+ TAB&lt;br /&gt;　　在选项上向前移动 TAB&lt;br /&gt;　　在选项卡上向前移动 CTRL+ TAB&lt;br /&gt;　　如果在“另存为”或“打开”&lt;br /&gt;　　对话框中选择了某文件夹，&lt;br /&gt;　　要打开上一级文件夹 BACKSPACE&lt;br /&gt;　　在“另存为”或“打开”对&lt;br /&gt;　　话框中打开“保存到”或&lt;br /&gt;　　“查阅” F4&lt;br /&gt;　　刷新“另存为”或“打开”&lt;br /&gt;　　对话框 F5&lt;br /&gt;六、使用“桌面”、“我的电脑”和“Windows资源管理器”快捷键&lt;br /&gt;　　选择项目时，可以使用以下快捷键。&lt;br /&gt;　　目的快捷键&lt;br /&gt;　　插入光盘时不用“自动播放”&lt;br /&gt;　　功能按住 SHIFT插入 CD-ROM&lt;br /&gt;　　复制文件按住 CTRL拖动文件&lt;br /&gt;　　创建快捷方式按住 CTRL+SHIFT拖动文件&lt;br /&gt;　　立即删除某项目而不将其放入 SHIFT+DELETE&lt;br /&gt;　　“回收站”&lt;br /&gt;　　显示“查找：所有文件” F3&lt;br /&gt;　　显示项目的快捷菜单 APPLICATION键&lt;br /&gt;　　刷新窗口的内容 F5&lt;br /&gt;　　重命名项目 F2&lt;br /&gt;　　选择所有项目 CTRL+ A&lt;br /&gt;　　查看项目的属性 ALT+ ENTER或 ALT+双击&lt;br /&gt;　　可将 APPLICATION键用于 Microsoft自然键盘或含有 APPLICATION键的其他兼容键&lt;br /&gt;七、Microsoft放大程序的快捷键&lt;br /&gt;　　这里运用Windows徽标键和其他键的组合。&lt;br /&gt;　　快捷键目的&lt;br /&gt;　　Windows徽标+PRINT SCREEN将屏幕复制到剪贴板（包括鼠标光标）&lt;br /&gt;　　Windows徽标+SCROLL LOCK将屏幕复制到剪贴板（不包括鼠标光标）&lt;br /&gt;　　Windows徽标+ PAGE UP切换反色。&lt;br /&gt;　　Windows徽标+ PAGE DOWN切换跟随鼠标光标&lt;br /&gt;　　Windows徽标+向上箭头增加放大率&lt;br /&gt;　　Windows徽标+向下箭头减小放大率&lt;br /&gt;八、使用辅助选项快捷键&lt;br /&gt;　　目的快捷键&lt;br /&gt;　　切换筛选键开关右SHIFT八秒&lt;br /&gt;　　切换高对比度开关左ALT+左SHIFT+PRINT SCREEN&lt;br /&gt;　　切换鼠标键开关左ALT+左SHIFT+NUM LOCK&lt;br /&gt;　　切换粘滞键开关 SHIFT键五次&lt;br /&gt;　　切换切换键开关 NUM LOCK五秒&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-7486059328015099427?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/7486059328015099427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=7486059328015099427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/7486059328015099427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/7486059328015099427'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/11/windows.html' title='Windows快捷键大全'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4337256856008054308</id><published>2007-10-24T07:53:00.000-07:00</published><updated>2007-10-24T07:54:06.086-07:00</updated><title type='text'>help debug</title><content type='html'>help debug&lt;br /&gt; Debugging commands.&lt;br /&gt;&lt;br /&gt;    dbstop     - Set breakpoint.&lt;br /&gt;    dbclear    - Remove breakpoint.&lt;br /&gt;    dbcont     - Resume execution.&lt;br /&gt;    dbdown     - Change local workspace context.&lt;br /&gt;    dbmex      - Enable MEX-file debugging.&lt;br /&gt;    dbstack    - List who called whom.&lt;br /&gt;    dbstatus   - List all breakpoints.&lt;br /&gt;    dbstep     - Execute one or more lines.&lt;br /&gt;    dbtype     - List M-file with line numbers.&lt;br /&gt;    dbup       - Change local workspace context.&lt;br /&gt;    dbquit     - Quit debug mode.&lt;br /&gt;&lt;br /&gt;    When a breakpoint is hit, MATLAB goes into debug mode, the debugger&lt;br /&gt;    window becomes active, and the prompt changes to a K&gt;&gt;.  Any MATLAB&lt;br /&gt;    command is allowed at the prompt. &lt;br /&gt;&lt;br /&gt;    To resume M-file function execution, use DBCONT or DBSTEP. &lt;br /&gt;    To exit from the debugger use DBQUIT.&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc debug&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4337256856008054308?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4337256856008054308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4337256856008054308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4337256856008054308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4337256856008054308'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/10/help-debug.html' title='help debug'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-4849495700587812219</id><published>2007-10-24T07:48:00.001-07:00</published><updated>2007-10-24T07:48:18.939-07:00</updated><title type='text'>help imread</title><content type='html'>[X,MAP] = IMREAD(FILENAME,FMT) reads the indexed image in FILENAME into&lt;br /&gt;    X and its associated colormap into MAP. Colormap values in the image&lt;br /&gt;    file are automatically rescaled into the range [0,1].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-4849495700587812219?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/4849495700587812219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=4849495700587812219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4849495700587812219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/4849495700587812219'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/10/help-imread.html' title='help imread'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-3876811225652265804</id><published>2007-10-24T07:39:00.000-07:00</published><updated>2007-10-24T07:40:44.754-07:00</updated><title type='text'>help  SUBPLOT</title><content type='html'>SUBPLOT Create axes in tiled positions.&lt;br /&gt;    H = SUBPLOT(m,n,p), or SUBPLOT(mnp), breaks the Figure window&lt;br /&gt;    into an m-by-n matrix of small axes, selects the p-th axes for&lt;br /&gt;    the current plot, and returns the axis handle.  The axes are&lt;br /&gt;    counted along the top row of the Figure window, then the second&lt;br /&gt;    row, etc.  For example,&lt;br /&gt;&lt;br /&gt;        SUBPLOT(2,1,1), PLOT(income)&lt;br /&gt;        SUBPLOT(2,1,2), PLOT(outgo)&lt;br /&gt;&lt;br /&gt;    plots income on the top half of the window and outgo on the&lt;br /&gt;    bottom half. If the CurrentAxes is nested in a uipanel the&lt;br /&gt;    panel is used as the parent for the subplot instead of the&lt;br /&gt;    current figure.&lt;br /&gt;&lt;br /&gt;    SUBPLOT(m,n,p), if the axis already exists, makes it current.&lt;br /&gt;    SUBPLOT(m,n,p,'replace'), if the axis already exists, deletes it and&lt;br /&gt;    creates a new axis.&lt;br /&gt;    SUBPLOT(m,n,p,'align') places the axes so that the plot boxes&lt;br /&gt;    are aligned, but does not prevent the labels and ticks from&lt;br /&gt;    overlapping.&lt;br /&gt;    SUBPLOT(m,n,P), where P is a vector, specifies an axes position&lt;br /&gt;    that covers all the subplot positions listed in P.&lt;br /&gt;    SUBPLOT(H), where H is an axis handle, is another way of making&lt;br /&gt;    an axis current for subsequent plotting commands.&lt;br /&gt;&lt;br /&gt;    SUBPLOT('position',[left bottom width height]) creates an&lt;br /&gt;    axis at the specified position in normalized coordinates (in&lt;br /&gt;    in the range from 0.0 to 1.0).&lt;br /&gt;&lt;br /&gt;    SUBPLOT(..., PROP1, VALUE1, PROP2, VALUE2, ...) sets the&lt;br /&gt;    specified property-value pairs on the subplot axis. To add the&lt;br /&gt;    subplot to a specific figure pass the figure handle as the&lt;br /&gt;    value for the 'Parent' property.&lt;br /&gt;&lt;br /&gt;    If a SUBPLOT specification causes a new axis to overlap an&lt;br /&gt;    existing axis, the existing axis is deleted - unless the position&lt;br /&gt;    of the new and existing axis are identical.  For example,&lt;br /&gt;    the statement SUBPLOT(1,2,1) deletes all existing axes overlapping&lt;br /&gt;    the left side of the Figure window and creates a new axis on that&lt;br /&gt;    side - unless there is an axes there with a position that exactly&lt;br /&gt;    matches the position of the new axes (and 'replace' was not specified),&lt;br /&gt;    in which case all other overlapping axes will be deleted and the&lt;br /&gt;    matching axes will become the current axes.&lt;br /&gt;&lt;br /&gt;    SUBPLOT(111) is an exception to the rules above, and is not&lt;br /&gt;    identical in behavior to SUBPLOT(1,1,1).  For reasons of backwards&lt;br /&gt;    compatibility, it is a special case of subplot which does not&lt;br /&gt;    immediately create an axes, but instead sets up the figure so that&lt;br /&gt;    the next graphics command executes CLF RESET in the figure&lt;br /&gt;    (deleting all children of the figure), and creates a new axes in&lt;br /&gt;    the default position.  This syntax does not return a handle, so it&lt;br /&gt;    is an error to specify a return argument.  The delayed CLF RESET&lt;br /&gt;    is accomplished by setting the figure's NextPlot to 'replace'.&lt;br /&gt;&lt;br /&gt;    Be aware when creating subplots from scripts that the Position&lt;br /&gt;    property of subplots is not finalized until either a drawnow&lt;br /&gt;    command is issued, or MATLAB returns to await a user command.&lt;br /&gt;    That is, the value obtained for subplot i by the command&lt;br /&gt;    get(h(i),'Position') will not be correct until the script&lt;br /&gt;    refreshes the plot or exits.&lt;br /&gt;&lt;br /&gt;    See also  gca, gcf, axes, figure, uipanel&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc subplot&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-3876811225652265804?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/3876811225652265804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=3876811225652265804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3876811225652265804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/3876811225652265804'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/10/help-subplot.html' title='help  SUBPLOT'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4916583487472719772.post-6611598614149355556</id><published>2007-10-24T07:38:00.000-07:00</published><updated>2007-10-24T07:39:00.732-07:00</updated><title type='text'>help figure</title><content type='html'>FIGURE Create figure window.&lt;br /&gt;    FIGURE, by itself, creates a new figure window, and returns&lt;br /&gt;    its handle.&lt;br /&gt; &lt;br /&gt;    FIGURE(H) makes H the current figure, forces it to become visible,&lt;br /&gt;    and raises it above all other figures on the screen.  &lt;span style="color: rgb(255, 0, 0);"&gt;If Figure H&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    does not exist, and H is an integer, a new figure is created with&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    handle H.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    GCF returns the handle to the current figure.&lt;br /&gt;&lt;br /&gt;    Execute GET(H) to see a list of figure properties and&lt;br /&gt;    their current values. Execute SET(H) to see a list of figure&lt;br /&gt;    properties and their possible values.&lt;br /&gt;&lt;br /&gt;    See also subplot, axes, gcf, clf.&lt;br /&gt;&lt;br /&gt;    Reference page in Help browser&lt;br /&gt;       doc figure&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4916583487472719772-6611598614149355556?l=matlabtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://matlabtips.blogspot.com/feeds/6611598614149355556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4916583487472719772&amp;postID=6611598614149355556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/6611598614149355556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4916583487472719772/posts/default/6611598614149355556'/><link rel='alternate' type='text/html' href='http://matlabtips.blogspot.com/2007/10/help-figure.html' title='help figure'/><author><name>Howell</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
