How to check if elements of one vector are greater than other in order?

I have vector a = [2,4,6] and vector b = [1,2,3];
How can I check that vector a1 elements are greater than b1, a2 greater than b2 and so on....

Answers (1)

a = [2,4,6]
b = [1,2,3];
idx=a>b
%The result
idx=1 1 1
the first 1 means a(1) > b(1)
the second 1 means a(2)>b(2)
and so on

Categories

Asked:

on 2 Nov 2013

Edited:

on 2 Nov 2013

Community Treasure Hunt

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

Start Hunting!