Array length: Difference between revisions
Content added Content deleted
(→{{header|Diego}}: Added Diego entry) |
Deadmarshal (talk | contribs) (Added Modula-3) |
||
Line 2,013: | Line 2,013: | ||
For arrays with more than one dimension, length reports the length of the larges dimension. The number of elements in a multi-dimensional array can be obtained with numel. |
For arrays with more than one dimension, length reports the length of the larges dimension. The number of elements in a multi-dimensional array can be obtained with numel. |
||
<lang Matlab>numel({'apple', 'orange'; 'pear', 'banana'})</lang> |
<lang Matlab>numel({'apple', 'orange'; 'pear', 'banana'})</lang> |
||
=={{header|Modula-3}}== |
|||
<lang modula3>MODULE ArrayLength EXPORTS Main; |
|||
IMPORT IO; |
|||
VAR |
|||
Arr:ARRAY[1..2] OF TEXT := |
|||
ARRAY[1..2] OF TEXT{"apples", "oranges"}; |
|||
BEGIN |
|||
IO.PutInt(NUMBER(Arr)); |
|||
END ArrayLength.</lang> |
|||
=={{header|Mercury}}== |
=={{header|Mercury}}== |