1
$\begingroup$

In 5 digital images I have determined the 2d coordinates of detected objects.

The resulting array (list) can be downloaded from here: http://pastebin.com/7bE0CEJ5

array= {{{1, {533.286, 574.643}}, ... , {443, {371., 3.5}}}}

array consists of 5 subarrays (for each image one):

Dimensions[array[[1]] = {443, 2}

Dimensions[array[[2]] = {443, 2}

Dimensions[array[[3]] = {444, 2}

Dimensions[array[[4]] = {442, 2}

Dimensions[array[[5]] = {443, 2}

If I try to show the Dimensions of array, I get the number of images:

Dimensions[array] = {5}

How can I get the complete Dimensions information of the list array?

$\endgroup$

1 Answer 1

5
$\begingroup$

Your subarrays are not all of equal dimensions. In particular subarrays 3 and 4 have a different amount of elements in their first dimension. Dimensions gives dimensions while the dimension is equal at all levels. Once it gets to a level with unequal dimensions it stops.

array = {{{1}, {2}, {3}}, {{1}, {2}}, {{1}, {2}}};

Dimensions@array
(* {3} *)

However, you can Map it across the subarrays to get your result.

Dimensions /@ array
(* {{3, 1}, {2, 1}, {2, 1}} *)

Hope this helps.

$\endgroup$
1
  • $\begingroup$ thank you very much $\endgroup$
    – mrz
    Dec 16, 2015 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.