comparing vectors for max and min

20 次查看(过去 30 天)
I am comparing two numerical vectors a and b. I want to create two new vectors-one is the element by element minimum of a(i) and b(i). The other has the maximums. are there functions that do this? The vectors are the same length.

采纳的回答

Alberto
Alberto 2014-9-29
Functions max and min do the trick:
a=randi(9,1,10)
b=randi(9,1,10)
vect_max = max(a,b)
vect_min = min(a,b)
  1 个评论
Jim
Jim 2014-9-29
Thanks. I did not read far enough into the min and max documentation.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Motion Modeling and Coordinate Systems 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by