📄 maxvalue.m
字号:
function [maxval, rmax, cmax] = maxvalue(A);
% function [maxvalue, rmax, cmax] = maxvalue(A);
% brief description of function here
%
% Inputs
% A: a matrix of size r x c, with r rows and c columns
%
% Outputs
% maxvalue: largest entry in A
% rmax, cmax: integers specifying the (row,column)
% location of the max value
% Get a row vector containing the maximum value within each column
% Store idx_row - a vector containing the location of
% the maximum within the column
[mx_row, idx_row] = max(A);
% find the maximum within this vector
[maxval, cmax] = max(mx_row);
% Use the idx_row to find the row location of the max
rmax = idx_row(cmax);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -