How to compare element between two numbers

How to compare element by element between two sequences for e.g i have K=[ 152 156 123 231 0] AND o=[ 173 152 197 234 67] if we compare these two numbers i need result value as M=[2 1 2 1 2] in matlab

댓글 수: 1

Rik
Rik 2019년 9월 23일
I don't see how your input and output are related. Can you provide more details about what should happen?

댓글을 달려면 로그인하십시오.

답변 (1개)

James Tursa
James Tursa 2019년 9월 23일

0 개 추천

Like Rik, I am not sure what comparison you are doing based on your terse description. Maybe this, but it doesn't match your stated desired output:
M = (o > K) + 1;
Can you elaborate more?

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2019년 9월 23일

답변:

2019년 9월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by