I have two set of numbers and want to compare and rank them relative to each other in MATLAB
.
The data is:
x = [3 7 8 25 33 52 64 65 78 79 91 93];
y = [7 10 12 27 30 33 57 62 80 83 85 90];
I started with the for/if/else
commands and got stuck in the middle.
In other words, I want to get the answer through MATLAB
how many times the numbers in the first group (x) are bigger than the ones in the second group (y
).
I got started with sorting etc.
n1 = length(data1);
n2 = length(data2);
xs = sort(x);
ys = sort(y);
r1 = zeros(1,n1);
r2 = zeros(1,n2);
I am open to use other commands than this kind of sorting and for/if/else
, it doesn't really matter, just need some help in the right direction.