Thursday 6 October 2016

Let A(1:8, -5:5, -10:5) be a three dimensional array. How many elements are there in the array A? | ISRO

Let A(1:8, -5:5, -10:5) be a three dimensional array. How many elements are there in the array A?

Ans :- 1408

Solution :-

You can find out using MATLAB formula or just simple trick :-

  • 1:8 has 8-1+1 = 8 elements
  • -5:5 has 5--5+1 = 11 elements
  • -10:5 has 5--10+1 = 16 elements
So the result is:
The matrix has 8*11*16 = 1408 elements in total.

No comments:

Post a Comment