Friday, August 7, 2015

length() function

 num = length(array) 

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


% Example
A = [101, 20;
    10, 24;
    11, 7];

%Function
ANSWER = length(A);

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

Result :

3

No comments:

Post a Comment