Subscript indices must either be real positive integers or logicals and other error.

1 visualizzazione (ultimi 30 giorni)
Hi,
I want to read through both matrixes seq and seq2 but gives me two errors. Here is the code:
tr = [0.95,0.05;
0.10,0.90];
e = [1/6, 1/6, 1/6, 1/6, 1/6, 1/6;
1/10, 1/10, 1/10, 1/10, 1/10, 1/2;];
seq1 = hmmgenerate(100,tr,e);
seq2 = hmmgenerate(200,tr,e);
seqs = {seq1,seq2};
[estTR, estE] = hmmtrain(seqs,tr,e);
pStates = hmmdecode(seqs,tr,e);
Error using hmmdecode (line 96)
The sequence must be numeric, or you must specify the symbols used in the sequence.
pStates = hmmdecode(seqs(i,:),tr,e);
Subscript indices must either be real positive integers or logicals.

Risposte (2)

Jan
Jan il 8 Feb 2013
It seems like you want to call the function hmmdecode(), but you have created a variable with the same name. Check this by:
dbstop if error
Then start the code and wait until Matlab stops. Then type in the command line:
which hmmdecode -all

Walter Roberson
Walter Roberson il 8 Feb 2013
I see that you have copied the example right from the documentation. We need to ask, though, which MATLAB version you are using, as you might be using an earlier version that does not support that example as-is.
Have you tried passing in a Symbols name/value pair?

Categorie

Scopri di più su Entering Commands in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by