Question: Determine dimension of array

Hi,

 

  I have the following input in order to obtain the dimension of an array, by means of the values has been assigned

 

with(ArrayTools):
with(LinearAlgebra):
f[1]:=1:
f[2]:=2:
nops(f);
Size(f);
Dimension(f);

 

  The result is 

---

1
[ 1 1 ]
Error, invalid input: LinearAlgebra:-Dimension expects its 1st argument, A, to be of type {Matrix, Vector} or coercible via `~Simplify`, but received f

 ---

 

I cannot get number "2", which is expected. Is there any way to obtain that? I looked for help and mapleprime, without any simple solution ......

 

Thank you very much!

  

Please Wait...