How to check if elements of one vector are greater than other in order?
Show older comments
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)
Azzi Abdelmalek
on 2 Nov 2013
Edited: Azzi Abdelmalek
on 2 Nov 2013
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
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!