Skip to content

Instantly share code, notes, and snippets.

@sauravrt

sauravrt/skeleton.m

Created Feb 22, 2014
Embed
What would you like to do?
Script to open editor with skeleton code structure in MATLAB
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