正在加载图片...
>) amn temp=mmin(temps) amn temp amx temp 24 -maxime 具有一个输出参量的函数mmin找出矩阵中的单个最小值。用第二个输出参量,返回单 个最小值的行和列的下标。除了mmax返回矩阵中的单个最大值外,函数mmax的工作方 式与mmin相同。这些M文件的函数是: function[m, i]=mmin(a) MMIN Matrix minimum value MMIN(A)returns the minimum value in the matrix A %o M, I=MMIN(A)in addition returns the indices of the minimum value in I=[row col] o Copyright(c)1996 by Prentice Hall, Inc if nargout==2, % return indices [m, 1=min(a) m-min(min(a» amn_temp=mmin(temps) amn_temp = 5 » [m , i]=mmin(temps) m = 5 i = 3 2 » amx_temp=mmax(temps) amx_temp = 24 » [m , j]=mmax(temps) m = 24 j = 30 3 具有一个输出参量的函数 mmin 找出矩阵中的单个最小值。用第二个输出参量,返回单 个最小值的行和列的下标。除了 mmax 返回矩阵中的单个最大值外,函数 mmax 的工作方 式与 mmin 相同。这些 M 文件的函数是: function [m , i]=mmin(a) % MMIN Matrix minimum value. % MMIN(A) returns the minimum value in the matrix A % [M,I] = MMIN(A) in addition returns the indices of % the minimum value in I = [row col]. % Copyright (c) 1996 by Prentice Hall,Inc. if nargout==2, % return indices [m , i]=min(a) ; [m , ic]=min(m) ; i=[i(ic) ic] ; else, m=min(min(a)); end
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有