Read data from textfile to use hmmtrain

Hi.
I wish to use hmmtrain in order to get transition and observation probabiliites (Baum Welch algorithm). Since I have all my data listed in a text file I wish to read that data and save it in a matrix to put it in the first parameter (seq) of hmmtrain(seq,tr,e);
Anyone can help please?
This is an example of what I want:
Data from text file: 1,3,2,3,2,3,1,3; 1,1,1,1,1,3;
Put data into seq variable: seq {[1,3,2,3,2,3,1,3],[1,1,1,1,1,3]};

답변 (1개)

Sean de Wolski
Sean de Wolski 2013년 2월 8일

0 개 추천

doc importdata %?

댓글 수: 4

Emmanuel
Emmanuel 2013년 2월 8일
I am almost there but I need to get data 1x4 cell and not 4x1 cell? is there any way how to do this please?
Sean de Wolski
Sean de Wolski 2013년 2월 8일
편집: Sean de Wolski 2013년 2월 8일
Transpose it:
c = c.'
Emmanuel
Emmanuel 2013년 2월 8일
thanks, the only problem that i have is that when it imports data 1,3,2,3,2,3,1,3 the commas are also included but i need to create a numeric from it. is there a way to achieve this?
Sean de Wolski
Sean de Wolski 2013년 2월 11일
When you import it, it has commas? This means the import isn't working properly. What happens if you import it using the import tool?
Can you paste the exact text of your text file into a comment or the original question?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

태그

질문:

2013년 2월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by