length( )


length( ) function in Matlab


Syntax:           num = length(array)


Description:   length(array) returns length along the largest dimension of the array or matrix.

Note:   For empty arrays, length is 0.







Code :



% Matlab Function - length
% Syntax : 
% d = length(A)
% equivalent to length(A) = max(size(A))

% Example
A = [10, 20;
    100, 200;
    11, 77];

%Function
ANSWER = length(A);

%Display result 
disp('Result: ');
disp(ANSWER);




Result :

3



No comments:

Post a Comment