MATLAB Function Review

Some functions can be confusing in MATLAB are discussed in detail.

surf

Official Description

surf(X,Y,Z) uses Z for the color data and surface height. X and Y are vectors or matrices defining the x and y components of a surface. If X and Y are vectors, length(X) = n and length(Y) = m, where [m,n] = size(Z). In this case, the vertices of the surface faces are (X(j), Y(i), Z(i,j)) triples. To create X and Y matrices for arbitrary domains, use the meshgrid function.

Explanation

From the description of surf function we can see, the most import thing to be noted is the dimension of vector X, vertor Y and matrix Z, where length(X) = the colum of Z and length(Y) = the row of Z. So, if we have following code: Read more

MATLAB快捷键

matlab的在窗口之间的切换总是用鼠标太麻烦,无意中看到一些快捷键,感觉非常实用,记录并分享以备忘记:

  1. 在Editor中各个窗口之间的切换
    快捷键ctrl+pageupctrl+pagedown之间可以实现在editor中所打开文件之间的切换
  2. 在IDE中各个窗口之间的切换
    ctrl+Tab 实现IDE中的各个窗口轮流转换
    ctrl+0(或者1、2、3、4)实现转换到特定窗口
    ctrl+shift+0切换到editor窗口
  3. 打开一个函数
    把光标|移动到函数名称里,ctrl+D