Created
February 22, 2014 17:20
-
-
Save sauravrt/9158398 to your computer and use it in GitHub Desktop.
Script to open editor with skeleton code structure in MATLAB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function skeleton | |
% Script to open editor with skeleton code structure | |
% Skeleton taken from | |
% http://www.cs.utah.edu/~germain/PPS/Topics/Matlab/function_design_pattern.html | |
content = sprintf(strcat('function return_value = name_of_function( parameters ) \n', ... | |
'%% Author: \n', ... | |
'%% Date: ', date, '\n', ... | |
'%% Partner: \n', ... | |
'%% Function : Name of Function \n', ... | |
'%% Purpose : What task does the function accomplish \n', ... | |
'%% or what does it compute', ... | |
'%% Parameters : What values/types are expected as input?\n', ... | |
'%% Return : What comes out of the function?\n', ... | |
'%% Examples of Usage (say for a sort function):\n', ... | |
'%% >> grades = [ 95 52 95 80 71 85 78 12 93 99 ];\n', ... | |
'%% >> sorted_array = sort( array )\n', ... | |
'%% \n', ... | |
'%% ans = [ 12 52 71 78 80 85 93 95 95 99 ] % % \n')); | |
matlab.desktop.editor.newDocument(content); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment