現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi all,
I have this kind of code:
seq1 = [1,3,2,3,2,3,1,3];
seq2 = [3,3];
seq3 = [1,2,2,2,2,2,2,2];
seq4 = [1,2,1,1,2,2,1,2,2,1,2];
seqs = {seq1, seq2, seq3, seq4};
How can I read seq1, seq2, seq3, seq4 from seqs since hmmdecode(seqs,tr,e) only accepts numeric? is there a way to do a loop in seqs parameter?
採用された回答
Azzi Abdelmalek
2013 年 2 月 8 日
seqs{1}
seqs{2}
12 件のコメント
Emmanuel
2013 年 2 月 8 日
but i need to run hmmdecode(seqs,tr,e) only once not twice.
Azzi Abdelmalek
2013 年 2 月 8 日
編集済み: Azzi Abdelmalek
2013 年 2 月 8 日
Maybe you can use cellfun,what are tr and e?
Azzi Abdelmalek
2013 年 2 月 8 日
編集済み: Azzi Abdelmalek
2013 年 2 月 8 日
cellfun(@(x) hmmdecode(x,tr,e) ,seqs,'un',0)
Emmanuel
2013 年 2 月 8 日
編集済み: Azzi Abdelmalek
2013 年 2 月 8 日
pStates = hmmdecode(cellfun(seqs),tr,e);
I think it does not give me what I need. It is used for getting mean, converience etc..
Azzi Abdelmalek
2013 年 2 月 8 日
cellfun(@(x) hmmdecode(x,tr,e) ,seqs,'un',0)
Emmanuel
2013 年 2 月 8 日
i got this error:
Error using cellfun Input #3 expected to be a cell array, was double instead.
Azzi Abdelmalek
2013 年 2 月 8 日
Check this (but you have to introduce tr and e)
seq1 = [1,3,2,3,2,3,1,3];
seq2 = [3,3];
seq3 = [1,2,2,2,2,2,2,2];
seq4 = [1,2,1,1,2,2,1,2,2,1,2];
seqs = {seq1, seq2, seq3, seq4};
out=cellfun(@(x) hmmdecode(x,tr,e) ,seqs,'un',0)
Emmanuel
2013 年 2 月 8 日
same error
Azzi Abdelmalek
2013 年 2 月 8 日
編集済み: Azzi Abdelmalek
2013 年 2 月 8 日
What are tr and e?
tr = [0.4,0.3,0.3;
0.4,0.3,0.3;
0.4,0.3,0.3;];
e = [0.4,0.3,0.3;
0.3,0.4,0.3;
0.3,0.3,0.4;];
Emmanuel
2013 年 2 月 8 日
solved it by doing : hmmdecode(cell2mat(seqs(1,:)),tr,e);
thanks a lot!
Azzi Abdelmalek
2013 年 2 月 8 日
Ok try this, copy and past this code
clear
tr = [0.4,0.3,0.3;0.4,0.3,0.3;0.4,0.3,0.3;];
e = [0.4,0.3,0.3;0.3,0.4,0.3;0.3,0.3,0.4;];
seq1 = [1,3,2,3,2,3,1,3];
seq2 = [3,3];
seq3 = [1,2,2,2,2,2,2,2];
seq4 = [1,2,1,1,2,2,1,2,2,1,2];
seqs = {seq1, seq2, seq3, seq4};
out=cellfun(@(x) hmmdecode(x,tr,e) ,seqs,'un',0)
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
