Names
- Capitalize constants.
- Use camel back notation for vairables, as in hiddenMarkovModel. CamelBack always starts with a lower case letter, and then uses an upper case letter for each new word. Acronyms, such as GaussianHMM, also follow this convention, so would be written as gaussianHmm.
- Names of functions should be written in lower case.
- It is clearest to have the function and its m-file names the same. Using lower case avoids potential filename problems in mixed operating system environments.
- To improve readability, underscore may be used.
- Prefix variables denoting a number of elements with the letter n as in nValue for the number of values.
- Suffix variables storing indices with Ndx as in dataNdx
Comments
- There is a convention that the first comment line after the function header will be searched by the lookfor command. Also, the first contiguous block of comments after the function header will be returned by the help and doc commands.
- http://stackoverflow.com/questions/3840657/matlab-m-file-help-formatting