How do I comment my MATLAB Script files

preview_player
Показать описание
We comment our first MATLAB script file to solve quadratic equations:

00:00 -Introduction
00:50 -Look back at our Script file to solve quadratic equation solver (link)
01:13 -Let’s explore best practices for commenting code
01:25 -Start by creating a general format for documentation
01:38 -Create two sections using double percent sign ‘%%’
02:07 -Documentation section versus Code body section
02:34 -Add space between double percent and comment for new section
02:54 -Enable Code Folding: Preferences in Environment section of Toolstrip
03:56 -The precise definition of a code section in MATLAB
04:08 -First line of documentation: script name and short description
04:30 -Help documentation: What problem does this code solve?
05:00 -Help documentation: Where can interested readers learn more?
05:57 -Help documentation: What additional information is useful?
06:34 -Provide brief description for each output produced by our code
07:50 -Provide Examples: Show example syntax to use our code
08:45 -Other required files: Identify any other files needed to run this code
09:40 -See also: point readers to other functions used in your code
10:13 -Authorship and version information
11:15 -Use code folding to strategically ignore nonactive sections
11:37 -Provide extensive comments in body of code
14:14 -Make your code sharable: write code for humans, not computers
14:55 -Community challenge: Provide links to resources to learn to comment
Рекомендации по теме
Комментарии
Автор

I came up with two questions after watching this video and was able to find two platforms that already had an answer to my question!

Q: How can I comment on a block of lines? What notation should I use?
A:

Q: How can I improve the readability of my MATLAB codes later when doing large projects?
A:

xoheey
Автор

I have a question as I'm working on the documentation of one of the A-level works (mortgage loan calculator). What should I write in the output session if I organize all my outputs in a table? More generally, how should we document our outputs in the future if they're not only a few numbers but are many values combined with tables or graphs?

shenyuehuang
join shbcf.ru