maxloc

版本 1.0.0.0 (1.5 KB) 作者: Ben Barrowes
Replicates the functionality of maxloc in fortran.
1.8K 次下载
更新时间 2008/3/26

查看许可证

%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)

引用格式

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

MATLAB 版本兼容性
创建方式 R2007b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Fortran with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0