File Exchange

image thumbnail

Open new m-file with standard header text in editor

version 1.0.0.0 (2.66 KB) by Kevin Bartlett
Creates a new m-file with standard function header text.

1 Download

Updated 09 Dec 2011

View License

Creates a new m-file in the current directory. The m-file is created with a standard header text, giving the Matlab version, operating system, author, date and time and, optionally, the author's organization (the values for the author and organization are customizable).

The m-file created is opened automatically in the Matlab editor.

The following is the contents of the m-file named 'myprogram.m', created with the command
newmf myprogram

function [] = myprogram()
%
% myprogram.m--
%
% Syntax:
%
% e.g.,

% Developed in Matlab 7.12.0.635 (R2011a) on GLNX86.
% Ada Lovelace (ada@example.com), 2011-12-09 12:29
%-------------------------------------------------------------------------

Cite As

Kevin Bartlett (2020). Open new m-file with standard header text in editor (https://www.mathworks.com/matlabcentral/fileexchange/34148-open-new-m-file-with-standard-header-text-in-editor), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Kevin Bartlett

Thanks for pointing those out. I searched the FileExchange for similar functions before posting newmf.m, but InsertHeader (which does not do quite the same thing) was the only one I found. I guess I didn't look hard enough.

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!