Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2008-05-23, 13:28   #1
dale516
初级会员
 
注册日期: 2008-05-23
年龄: 39
帖子: 1
声望力: 0
dale516 正向着好的方向发展
微笑 [求助]问个有关取最小值的问题~

呃...问个很弱智的问题~
比如:已知X10,X11,X12,X20,X21,X22,X30,X31,X32九个变量的经过计算得到的具体数值,
然后有行矩阵A,矩阵中的元素是由以上9个变量中的任意3个取最小值,进行排列组合出的1x27的行矩阵。
问题,matlab里有没有指令,可以直接比较三个变量的最小值并输出...我拿C里的循环嵌套,3个一组比较的...实在很崩溃~:ft:
:lovely: 希望达人指点,表嘲笑我啊~我是需要时才现学的菜鸟...先谢谢了!~
dale516 当前离线   回复时引用此帖
旧 2008-05-23, 20:37   #2
Just For Matlab
初级会员
 
注册日期: 2008-05-23
年龄: 38
帖子: 5
声望力: 0
Just For Matlab 正向着好的方向发展
微笑

matlab里面有个求最小值的函数min,具体用户可以查看帮助
在命令窗口输入help min就会列出一系列关于min的用法,不过全是英文
好好钻研吧
help min
MIN Smallest component.
For vectors, MIN(X) is the smallest element in X. For matrices,
MIN(X) is a row vector containing the minimum element from each
column. For N-D arrays, MIN(X) operates along the first
non-singleton dimension.

[Y,I] = MIN(X) returns the indices of the minimum values in vector I.
If the values along the first non-singleton dimension contain more
than one minimal element, the index of the first one is returned.

MIN(X,Y) returns an array the same size as X and Y with the
smallest elements taken from X or Y. Either one can be a scalar.

[Y,I] = MIN(X,[],DIM) operates along the dimension DIM.

When complex, the magnitude MIN(ABS(X)) is used, and the angle
ANGLE(X) is ignored. NaN's are ignored when computing the minimum.

Example: If X = [2 8 4 then min(X,[],1) is [2 3 4],
7 3 9]

min(X,[],2) is [2 and min(X,5) is [2 5 4
3], 5 3 5].
Just For Matlab 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码


相似的主题
主题 主题作者 版面 回复 最后发表
[求助]matlab的图论工具箱GrTheory怎么用? beyondcom MATLAB论坛 0 2008-05-25 20:01
求助!floodfill 怎么用 用的时候要注意什么 tancncos MATLAB论坛 0 2008-05-09 12:55
MATLAB计算中的小问题,那位大神帮帮忙! stormbird MATLAB论坛 2 2007-06-19 23:57
【求助】两个关于dirac函数和傅立叶变换的问题,诚教! raydreambo MATLAB论坛 1 2007-05-21 20:36


所有时间均为北京时间。现在的时间是 11:32


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.