Typescript Index Last Element Of Array Matlab Function Handle