6

What is the convention for writing Matlab code as used in built-in matlab functions and major toolboxes: CamelCase or snake_case?

Keji Li
  • 62
  • 1
  • 7
user1710794
  • 105
  • 1
  • 6
  • 1
    It's completely subjective, but looking at MathWorks code, I'd say neither. However, the error message IDs are generally written in CamelCase. – chappjc Oct 26 '13 at 04:09
  • It's whatever your MATLAB coding guidelines say. – Rody Oldenhuis Oct 26 '13 at 09:02
  • I prefer to use lower case for MATLAB programming to „turn off“ case sensitivity (coding rules: http://goo.gl/TfVX9E). – BHF Oct 26 '13 at 09:20
  • 1
    See also this question and answers: [MATLAB programming best practices](http://stackoverflow.com/questions/5042761/matlab-programming-best-practices/5050674). Richard K. Johnson's book ["The Elements of MATLAB Style"](http://www.amazon.com/dp/0521732581) may have something to say on this. One thing that I've seen is that Classes tend to use upper camel case (e.g., `VideoWriter`) and methods of objects use lower camel case. (e.g., `writeVideo`). – horchler Oct 26 '13 at 14:15

0 Answers0