Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のような配列(matlab内)があるとします:
A = [ 1 1 1 3 6 2 2 2 3 4 3 3];
別の配列が必要です X が A の要素のうち、カウントが 3 を超える要素を含む配列であるとします。たとえば、X は [1 2 3] である必要があります。
私のためにこれを行うことができる機能はありますか?もしそうなら、それは何ですか?
これは and を使用してそれをunique行いhistcます:
unique
histc
A = [1 1 1 3 6 2 2 2 3 4 3 3]; u = unique(A); X = u(histc(A,u)>=3)
返す
X = 1 2 3