How to get the max value between two elements of two separate arrays?
조회 수: 49 (최근 30일)
이전 댓글 표시
Hello everyone, thanks for reading
What I'm trying to do is this:
I have these two arrays:
a= [1,3,4,6]
b= [2,2,5,4]
I want to get a new 'c' array with the max values of a comparison between each element of 'a' and 'b'
this -----------> c= [2,3,5,6]
댓글 수: 0
채택된 답변
추가 답변 (1개)
Stephen23
2022년 10월 21일
The efficient MATLAB approach:
a = [1,3,4,6];
b = [2,2,5,4];
c = max(a,b)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!