%Sample data
mat = magic(4);
mat = [mat; 1 4 9 16]
%Get the maximum value
val = max(mat, [], 'all')
%% Find the indices of all occurences of the max value
%Linear indices
idx = find(mat==val)
%Subscript indices
[r,c] = find(mat==val)
Note - Use tolerance to compare for floating point values.