matlab中如何在行矩阵中找出某一个数小于与其之后数的个数?谢

2025-01-02 18:50:12
推荐回答(1个)
回答1:

>> A = [14 21 20 61 28 20 2 75 45 94];
R = [];
for k = 1:length(A)
a = (A-A(k)*ones(1,length(A)))>0;
mi = sum(a(k:end));
R = [R mi];
end;
R
R =
8 5 5 2 3 3 3 1 1 0