how can I create help product for my function in matlab?

How can I create file help (syntax,description,example,...) for my function in matlab?

Answers (2)

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
Thank you @James Tursa, I mean I want to find it in help like cos,sin...can I do this

Asked:

on 11 Dec 2017

Answered:

on 11 Dec 2017

Community Treasure Hunt

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

Start Hunting!