how to count number of states in sequence?
1 回表示 (過去 30 日間)
古いコメントを表示
Suppose I have a sequence 1,3,3,1,2,1,4,2,3,1,4,2,4,4,4,3,1,2,5,1 in this 5 states are there, so how to count that there are 5 states.
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2016 年 5 月 5 日
編集済み: Azzi Abdelmalek
2016 年 5 月 5 日
a=[1,3,3,1,2,1,4,2,3,1,4,2,4,4,4,3,1,2,5,1]
out=unique(a)
number_of_states=numel(out)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Markov Chain Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!