how can I create help product for my function in matlab?
Show older comments
How can I create file help (syntax,description,example,...) for my function in matlab?
Answers (2)
James Tursa
on 11 Dec 2017
Edited: James Tursa
on 11 Dec 2017
Put all of your help text in comments at the top of the file. E.g., here is a file called mycube.m
% MYCUBE Calculates the cube of each element
% Syntax:
% Y = mycube(X)
% where
% X = any numeric variable
% Y = array the same size as X, with each element cubed.
function Y = mycube(X)
Y = X.^3;
end
Note that a short description in the first line using key words enables this function to be found with the "lookfor" function.
>> help mycube
MYCUBE Calculates the cube of each element
Syntax:
Y = mycube(X)
where
X = any numeric variable
Y = array the same size as X, with each element cubed.
>> lookfor cube
mycube - Calculates the cube of each element
mycube - Calculates the cube of each element
colorcube - Enhanced color-cube color map.
soma - display precomputed solutions to Piet Hein's soma cube
somasols - Solutions to the SOMA cube.
lhspoint - Generates Latin hypercube points.
pderot3d - Track mouse motion with rotating cube.
lhsdesign - Generate a latin hypercube sample.
lhsnorm - Generate a latin hypercube sample with a normal distribution
zeyneb khalili
on 11 Dec 2017
0 votes
Categories
Find more on Industrial Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!