maxloc

Replicates the functionality of maxloc in fortran.
1,8K Downloads
Aktualisiert 26. Mär 2008

Lizenz anzeigen

%function out=maxloc(x,dim)
%
% Replicates the functionality of maxloc in fortran.
%
% INPUTS: x -> data variable
% dim -> (optional) dimension upon which to operate
% (same in Fortran and Matlab)
%
% OUTPUTS: out -> set to second output of Matlab's max() if dim is specified
% otherwise, is the maximum location for the entire array
% returned as a cell array resulting from ind2sub
% this could then be used as a subscript list
%
% EXAMPLES: a=magic(5); b=maxloc(a); a(b{:}),b
% b=maxloc(a,1)

Zitieren als

Ben Barrowes (2024). maxloc (https://www.mathworks.com/matlabcentral/fileexchange/19331-maxloc), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2007b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Fortran with MATLAB finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0