In Matlab, end
index lets me access a last item.
> array = [1 2 3 4 5 6 7];
> array(end)
ans = 7
How do I do the same i
there is no such convenience notation, you need to do this
array(size(array))
in older fortran versions you dont even have size()
and need to track the dimension yourself
worth a note fortran arrays can be defined to have negative indices, so the end notation used in some other languages would be ambiguous
array ( ubound (array) )
size
will only work if the array is 1-indexed.