String
Abs -- output string ASCII code
Strvcat -- horizontally connects multiple strings to grow strings
Fprintf -- write formatted text to a file or display screen
Int2str -- convert an integer to a string
Num2str -- convert a number to a string
Sprintf -- use format control and convert numbers into strings
Eval -- evaluate the value of a string as a MATLAB command -- macro definition
Use EPS to replace the zero element in an array. the EPS is approximately 2.2e-16, which is useful when division by 0.
X = (-3: 3)/3
X = x + (x = 0) * EPS;
Sin (x)./x
Nans -- all operations on nans get nans
Empty matrix -- variable with a size of 0 -- isempty
Try statement -- assign the error message to the reserved lasterr variable
The communication between a function and a MATLAB workspace can only be achieved through the variables passed to it and the output variables it creates. The intermediate variable in the function does not appear in the MATLAB workspace.
Comment on the first line of the function-provide lookfor keyword search and help for online help
When a function has more than one output variable, the output variable is included in brackets.
The function workspace variable nargin contains the number of input parameters and nargout contains the number of output parameters.
Error displays a string in the Command window, giving up function execution, and returning control to the keyboard
Script File-a set of MATLAB commands arranged by user intent
The variables generated by running the script file reside in the basic Workspace of MATLAB.
M file -- the function name and file name must be the same
Anonymous function-the generated function handle variable does not point to a specific function, but a function expression.
Variable name = @ (input parameter list) operation expression
Mysqrl = @ (x) X. * x the property of mysqrl is the function handle variable, not the expression.
The inline function is not a function handle. variables can be used to represent the function.
Variable name = inline ('function expression', 'variable name') -- if it is a common variable name, the variable name list can be omitted, but it is not recommended
The function file can contain one or more sub-functions. The main function is the first function in the M file.
A subfunction can only be called by the primary function and other subfunctions in the same function file.
Function handle: -- alias of the function name
Variable name = @ function name
MATLAB-programming Basics