作业帮 > 综合 > 作业

在matlab编程时,怎样取出矩阵的每行中的最小值?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/01 00:45:04
在matlab编程时,怎样取出矩阵的每行中的最小值?
B=min(A,[],1) 取出矩阵的每行中的最小值
再问: 高手,那怎么取最小值的坐标呢?
再答: min Smallest elements in array Syntax C = min(A) C = min(A,B) C = min(A,[],dim) [C,I] = min(...) Description C = min(A) returns the smallest elements along different dimensions of an array. If A is a vector, min(A) returns the smallest element in A. If A is a matrix, min(A) treats the columns of A as vectors, returning a row vector containing the minimum element from each column. If A is a multidimensional array, min operates along the first nonsingleton dimension. C = min(A,B) returns an array the same size as A and B with the smallest elements taken from A or B. The dimensions of A and B must match, or they may be scalar. C = min(A,[],dim) returns the smallest elements along the dimension of A specified by scalar dim. For example, min(A,[],1) produces the minimum values along the first dimension (the rows) of A. [C,I] = min(...) finds the indices of the minimum values of A, and returns them in output vector I. If there are several identical minimum values, the index of the first one found is returned. [C,I] = min(A,[],1) I为下标
再问: D =[ 8.7321 1.4142 8.0623 9.4868 0.5000 7.2801 5.6569 7.8102 6.1847 1.4142 5.3852 7.0711 7.4330 0 6.7082 8.2462 8.2006 9.2195 3.1623 1.0000 4.6098 7.2111 1.0000 2.8284]; [B,i]=min(D,[],1) ; 这样运算之后并非取的是矩阵D每一行的最小值及其坐标啊!
再答: a=[1 2 3;4 5 6;7 8 9]; [C I]=mian(a,[],1); 你自己看
再问: 嗯,知道了!谢谢啊……