フィルターのクリア

Is there a document describing MATLAB coding standards or a good programming guide available?

121 ビュー (過去 30 日間)
I am looking for documents that can help improve my MATLAB programming skill. I would be interested in any helpful online guides.

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 1 月 18 日
編集済み: MathWorks Support Team 2024 年 3 月 1 日
MathWorks does not have documentation specific to best practices for writing MATLAB code. MathWorks recommends that each user/organization develops the practices that suit them the best.
However, here are some useful resources:
Look at the documentation on the MATLAB Code Analyzer Report, which helps in improving code through warning and error messages:
Loren's blog contains some useful best practices for writing code in MATLAB:
Here are some more documentation pages to improve performance and memory usage in scripts:
There are also two good documents on MATLAB Central that may be helpful, but as they are developed by our users, we do not guarantee or warrant their content:
MATLAB Programming Style Guidelines 2.0
Good MATLAB Programming Practices
Please follow the below link to search for the required information regarding the current release:

その他の回答 (1 件)

Co Melissant
Co Melissant 2022 年 10 月 5 日
編集済み: Co Melissant 2022 年 10 月 5 日
Since January 2022 we have the MonkeyProof MATLAB Coding Standard, see https://doc.monkeyproofsolutions.nl/code-checker-for-matlab/monkeyproof-matlab-coding-standard/
This standard has a Change Control Board (CCB) and is written together with some industry-leaders and TIOBE https://www.tiobe.com, a company specialized in Coding Standards and Code Quality
  5 件のコメント
Co Melissant
Co Melissant 2023 年 4 月 14 日
There can be various reasons to go for char or for string to handle text, I mentioned a few as well. This is why CC4M can check on both. Also there is currently is no rule in the standard. But a rule is there to have exemptions on it :)
Stephen23
Stephen23 2023 年 4 月 14 日
編集済み: Stephen23 2023 年 4 月 14 日
"I do not agree that character vectors should be considered deprecated."
I do not consider CHAR arrays as deprecated.
I do note that many users these days seems to expect text to be "atomic", perhaps due to experience with other programming languages and environments. SPRINTF et al processing arrays in memory-order produces countless threads on this forum... in contrast, overloaded PLUS (and COMPOSE, etc.) intuitively match what many users see and expect. For many common text tasks, it seems STRING is simpler.
It is also clear that the behavior of code can be very very different if users are not paying attention to these types and writing their code taking their differing properties into account:
I presumed that one point of an automated coding check is to warn for these kind of compatibility issues.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by