MATLAB comma usage topics

comma,

Comma used as a separator, can be used to separate the array subscripts, create separate line element (equivalent to a space) of the array, a plurality of the partition function of the input / output parameters, the same plurality of spaced row statement command (display output).

Array subscript partition, creating an array of elements spaced row, this time is equivalent to the space.

A = [1,2;3 4];

When the function has a plurality of input / output parameters, separated by commas between the various parameters.

[M,I] = max(A,[],2);

If you want to enter multiple commands on one line, may be separated by commas. Note that the comma will display output.

A = 1, B = [1,2,3,4 ]; C = [0,1],
the output part is commented :( output)
%. 1 A =
% C = 0. 1
above statements, in the same line, a, C, terminated with a comma assignment, so there will be output level; B semicolon at the end, there is no output.

Released nine original articles · won praise 18 · views 1501

Guess you like

Origin blog.csdn.net/bj_zhb/article/details/104038853