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일

1 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Predictive Maintenance Toolbox에 대해 자세히 알아보기

질문:

Jim
2014년 9월 29일

댓글:

Jim
2014년 9월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by