0001 function mrg_newfunc
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 [fname,fpath] = uiputfile('*.m', 'Enter a name and location for the function', 'mrg_FUNC_NAME.m');
0040
0041 bptext = ['function [OUT1, OUT2] = %s(IN1, IN2)\r\n',...
0042 '%% DESCRIPTION. What does the function do?\r\n',...
0043 '%%\r\n',...
0044 '%% -- Read and Delete -- \r\n',...
0045 '%% Please fill out the description line above and the sections below. At a\r\n',...
0046 '%% minimum please document the INPUT and OUTPUT sections. If additional\r\n',...
0047 '%% sections headings are justified (e.g WARNING) please add these too.\r\n',...
0048 '%% -- Ends --\r\n',...
0049 '%%\r\n',...
0050 '%% INPUT\r\n',...
0051 '%% IN1 DESCRIPTION\r\n',...
0052 '%% IN2 DESCRIPTION\r\n',...
0053 '%%\r\n',...
0054 '%% OUTPUT\r\n',...
0055 '%% OUT1 DESCRIPTION\r\n',...
0056 '%% OUT2 DESCRIPTION\r\n',...
0057 '%% If no output please state: NO OUTPUT AT CONSOLE\r\n',...
0058 '%%\r\n',...
0059 '%% USAGE\r\n',...
0060 '%% Provide an example to show how the function should be used\r\n',...
0061 '%%\r\n',...
0062 '%% NOTES\r\n',...
0063 '%% Additional (more verbose) documentation can go here.\r\n',...
0064 '%%\r\n',...
0065 '%% REQUIREMENTS\r\n',...
0066 '%% List external toolboxes, platform dependencies etc here.\r\n',...
0067 '%% If external toolboxes are needed, please provide links and state what\r\n',...
0068 '%% version was used for development and testing.\r\n',...
0069 '%%\r\n',...
0070 '%% OCTAVE COMPATIBILITY\r\n',...
0071 '%% If your code is Octave compatible? Yes, No, or Untested.\r\n',...
0072 '%%\r\n',...
0073 '%% REFERENCES\r\n',...
0074 '%% Please list references here in a consistent, human readable format.\r\n',...
0075 '%%\r\n',...
0076 '%% AUTHORS\r\n',...
0077 '%% YOUR NAME HERE!\r\n',...
0078 '%%\r\n',...
0079 '%% LICENCE\r\n',...
0080 '%% Code distributed as part of the MRG toolbox from the Marine Research\r\n',...
0081 '%% Group at Queens University Belfast (QUB) School of Planning\r\n',...
0082 '%% Architecture and Civil Engineering (SPACE). Distributed under a\r\n',...
0083 '%% creative commons CC BY-SA licence, retaining full copyright of the\r\n',...
0084 '%% original authors.\r\n',...
0085 '%%\r\n',...
0086 '%% http://creativecommons.org/licenses/by-sa/3.0/\r\n',...
0087 '%% http://www.qub.ac.uk/space/\r\n',...
0088 '%% http://www.qub.ac.uk/research-centres/eerc/\r\n',...
0089 '%%\r\n',...
0090 '%% DEVELOPMENT\r\n',...
0091 '%% v 1.0 YYYY-MM-DD\r\n',...
0092 '%% First version. INITIALS\r\n',...
0093 '%%\r\n',...
0094 '%% TODO\r\n',...
0095 '%% LIST\r\n',...
0096 '%%\r\n',...
0097 '%%\r\n',...
0098 '%%%% Function Begin!\r\n',...
0099 '\r\n',...
0100 '\r\n',...
0101 '\r\n',...
0102 'end\r\n'];
0103
0104 fileID = fopen([fpath, fname],'w');
0105 funcname = fname(1:end-2);
0106 fprintf(fileID,bptext,funcname);
0107 fclose(fileID);
0108
0109 edit([fpath, fname])
0110
0111 end
0112