{"id":19855834,"url":"https://github.com/cuixing158/matlabcommenttemplate","last_synced_at":"2025-05-02T01:31:21.597Z","repository":{"id":59948365,"uuid":"469341457","full_name":"cuixing158/matlabCommentTemplate","owner":"cuixing158","description":"Easy to use m-file comment template!","archived":false,"fork":false,"pushed_at":"2025-03-13T03:33:55.000Z","size":269,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T20:47:44.081Z","etag":null,"topics":["code-generation","code-template","comments","matlab"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuixing158.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":"https://raw.githubusercontent.com/cuixing158/OpticalFlow-Visualization/refs/heads/main/README_media/sponsors.jpg"}},"created_at":"2022-03-13T10:45:59.000Z","updated_at":"2025-03-13T03:33:59.000Z","dependencies_parsed_at":"2025-03-13T04:22:48.815Z","dependency_job_id":"bd88669f-c8fa-473b-aac0-22c4052aa05e","html_url":"https://github.com/cuixing158/matlabCommentTemplate","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FmatlabCommentTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FmatlabCommentTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FmatlabCommentTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FmatlabCommentTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuixing158","download_url":"https://codeload.github.com/cuixing158/matlabCommentTemplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251969398,"owners_count":21673194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","code-template","comments","matlab"],"created_at":"2024-11-12T14:13:50.135Z","updated_at":"2025-05-02T01:31:21.592Z","avatar_url":"https://github.com/cuixing158.png","language":"MATLAB","funding_links":["https://raw.githubusercontent.com/cuixing158/OpticalFlow-Visualization/refs/heads/main/README_media/sponsors.jpg"],"categories":[],"sub_categories":[],"readme":"[![Sponsor](https://img.shields.io/badge/-Sponsor-red?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=white)](https://raw.githubusercontent.com/cuixing158/OpticalFlow-Visualization/refs/heads/main/README_media/sponsors.jpg)\n[![View matlabCommentTemplate on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://ww2.mathworks.cn/matlabcentral/fileexchange/107879-matlabcommenttemplate)\n\n# Matlab functions and class comment template\nEasy to use m-file comment template! Custom/predefined comment modules for matlab functions and classes.\u003cbr\u003e\n\n## How to install\n\n double-click directly on \"header.mlappinstall\" or add \"header.m\" to your [MATLAB Search Path](https://www.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html).\n\n## How to use\n1. Open the script m file you want to comment;\u003cbr\u003e\n1. Type \"header\" in the command window or click on the \"header\" icon in the *Quick Access Toolbar*(if you add).\u003cbr\u003e\n\nfor example:\n\n![111](https://github.com/user-attachments/assets/a2da4b8e-e810-4394-8052-3103d5444462)\n\n\n## How to modify the template to suit your needs?\n\nType this on the command line:`edit header.m`,then modify the [arguments parameters block](https://github.com/cuixing158/matlabCommentTemplate/blob/d4405224531074040582f8f5129cf81deb1e03d4/header.m#L57) to suit your needs.\u003cbr\u003e\n\n## Examples\nDefine the function or class file in your script(it is not necessary to define it completely, only the function prototype signature is needed), then press the shortcut **\"alt\" + \"1\"** or click the \"header\" header in the **\"Quick Access Toolbar\"** or type **`header`** In the command line window.If you don't want to automatically insert comments in some functions or classes, you can ignore them by starting the line below the function or class signature with \"%\".\u003cbr\u003e\n- function example\n```matlab\nt = 1:.1:2*pi;\ny = sin(t);\nplot(t,y);\n\nfunction out = myfun1(a,b,c)\n% Brief: One line description of what the function or class performs\n% Details:\n%    None\n% \n% Syntax:  \n%     out = myfun1(a,b,c)\n% \n% Inputs:\n%    a - [m,n] size,[double] type,Description\n%    b - [m,n] size,[double] type,Description\n%    c - [m,n] size,[double] type,Description\n% \n% Outputs:\n%    out - [m,n] size,[double] type,Description\n% \n% Example: \n%    None\n% \n% See also: None\n\n% Author:                          yourname\n% Email:                           youremail@email.com\n% Created:                         27-Mar-2022 20:13:59\n% Version history revision notes:\n%                                  None\n% Implementation In Matlab R2022a\n% Copyright © 2022 yourOrganization.All Rights Reserved.\n%\nout = a+b+c;\nend \n\nfunction out = myfun2(argument1,argument2,...\n    argument3,argument4,...\n    argument5,argument6)\n% Brief: One line description of what the function or class performs\n% Details:\n%    None\n% \n% Syntax:  \n%     out = myfun2(argument1,argument2,argument3,argument4,argument5,argument6)\n% \n% Inputs:\n%    argument1 - [m,n] size,[double] type,Description\n%    argument2 - [m,n] size,[double] type,Description\n%    argument3 - [m,n] size,[double] type,Description\n%    argument4 - [m,n] size,[double] type,Description\n%    argument5 - [m,n] size,[double] type,Description\n%    argument6 - [m,n] size,[double] type,Description\n% \n% Outputs:\n%    out - [m,n] size,[double] type,Description\n% \n% Example: \n%    None\n% \n% See also: None\n\n% Author:                          yourname\n% Email:                           youremail@email.com\n% Created:                         27-Mar-2022 20:13:59\n% Version history revision notes:\n%                                  None\n% Implementation In Matlab R2022a\n% Copyright © 2022 yourOrganization.All Rights Reserved.\n%\nout = argument1+argument2+argument3+argument4+argument5+argument6;\nend \n```\n\n- classdef example\n```matlab\nclassdef Motor \u003c ElectricVehicleComponent\n% Brief: One line description of what the function or class performs\n% Details:\n%    None\n% \n% Syntax:  \n%     Motor \u003c ElectricVehicleComponent\n% \n% Inputs:\n%    None\n% \n% Outputs:\n%    None\n% \n% Example: \n%    None\n% \n% See also: None\n\n% Author:                          yourname\n% Email:                           youremail@email.com\n% Created:                         27-Mar-2022 20:16:17\n% Version history revision notes:\n%                                  None\n% Implementation In Matlab R2022a\n% Copyright © 2022 yourOrganization.All Rights Reserved.\n%\n   \n    properties\n        CurrentSpeed = 0\n        SpeedRange = [0, 180]\n    end\n\n    methods\n        function motor = start(motor,speed)\n% Brief: One line description of what the function or class performs\n% Details:\n%    None\n% \n% Syntax:  \n%     motor = start(motor,speed)\n% \n% Inputs:\n%    motor - [m,n] size,[double] type,Description\n%    speed - [m,n] size,[double] type,Description\n% \n% Outputs:\n%    motor - [m,n] size,[double] type,Description\n% \n% Example: \n%    None\n% \n% See also: None\n\n% Author:                          yourname\n% Email:                           youremail@email.com\n% Created:                         27-Mar-2022 20:16:17\n% Version history revision notes:\n%                                  None\n% Implementation In Matlab R2022a\n% Copyright © 2022 yourOrganization.All Rights Reserved.\n%\n            arguments\n                motor (1,1) Motor\n                speed (1,1) {mustBeReal, mustBeNonnegative}\n            end\n            if motor.CurrentSpeed \u003e 0\n                error(\"Motor:start:MotorAlreadyRunning\",...\n                    \"Cannot start a motor that is already running.\")\n            end\n            motor.CurrentSpeed = speed;   \n        end\n        \n        function motor = stop(motor)\n% Brief: One line description of what the function or class performs\n% Details:\n%    None\n% \n% Syntax:  \n%     motor = stop(motor)\n% \n% Inputs:\n%    motor - [m,n] size,[double] type,Description\n% \n% Outputs:\n%    motor - [m,n] size,[double] type,Description\n% \n% Example: \n%    None\n% \n% See also: None\n\n% Author:                          yourname\n% Email:                           youremail@email.com\n% Created:                         27-Mar-2022 20:16:17\n% Version history revision notes:\n%                                  None\n% Implementation In Matlab R2022a\n% Copyright © 2022 yourOrganization.All Rights Reserved.\n%\n            if motor.CurrentSpeed == 0\n                error(\"Motor:start:MotorNotRunning\",...\n                    \"Cannot stop a motor that is not running.\")\n            end\n            motor.CurrentSpeed = 0;\n        end\n    end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuixing158%2Fmatlabcommenttemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuixing158%2Fmatlabcommenttemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuixing158%2Fmatlabcommenttemplate/lists"}