标题: Matlab编程风格指南 [打印本页] 作者: sundianming 时间: 2010-4-5 00:00 标题: Matlab编程风格指南 本帖最后由 厚积薄发 于 2010-4-5 12:00 编辑 4 m3 _0 U( { H" y! V" ~* ?0 X: R9 Y9 T0 e* l
有关 MATLAB代码的建议通常强调的是效率,譬如说有关“不要用循环”等的建议,这本指南与之不同。这本指南主要考虑的是代码(格式)的正确性、清晰性与通用性。文章的目的在于帮助写出更可能正确、易于理解、更具有共享性与更利于维护的代码。正如Brian Kernighan 写道:“Well-written programs are better than badly-written ones--they have fewer errors and are easier to debug and to modify――so it is important to think about style from the beginning.”(良好的写作规范的程序比糟糕的写作规范的要好,因为他们具有较少的错误、易于调试与修改,因此,从一开始就考虑风格是很重要的)。