counting without built in function?

2 ビュー (過去 30 日間)
Lee
Lee 2013 年 4 月 15 日
how do i create a function that counts the number of time that a given marix is between the 2 row elements of another given matrix for exmple i get the maatrix a=[20 30 49 50] and the second matrx b eaqual: 0 10 10 20 20 30 30 40 40 50 i need a function that will return the number of time a is between rows of b in this case something like that 0 0 1 2 1

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2013 年 4 月 15 日
out = histc(a,[b(:,1)',b(end)])

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by