Skip to content

Instantly share code, notes, and snippets.

@YimianDai
Created July 30, 2019 23:37
Show Gist options
  • Save YimianDai/550a18bda16e271725ea6efe0f7c2680 to your computer and use it in GitHub Desktop.
Save YimianDai/550a18bda16e271725ea6efe0f7c2680 to your computer and use it in GitHub Desktop.
Notes on Matlab

Matlab Notes

命名规则

参考 Python 代码规范和命名规范

ind2sub

矩阵既可以用单个坐标,可以用(行,列)两个坐标,ind2sub 是转换的函数

[I,J] = ind2sub(siz,IND)
[I1,I2,I3,...,In] = ind2sub(siz,IND)

The single ampersand & is the logical AND operator. The double ampersand && is again a logical AND operator that employs short-circuiting behaviour. Short-circuiting just means the second operand (right hand side) is evaluated only when the result is not fully determined by the first operand (left hand side)

A & B (A and B are evaluated)

A && B (B is only evaluated if A is true)

在图像上画矩形

Position 的格式是 [x y w h],x y 是 lower left corner of the rectangle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment