How to extract data from a long csv object that is given as a single text variable
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Stewart Smith
am 16 Okt. 2019
Beantwortet: Ankit Kumar
am 23 Okt. 2019
I have a single long text variable from a table A that looks like this:
A{1}=‘[WAKE,WAKE,WAKE,DEEP,LIGHT,REM,WAKE,REM,WAKE,REM,WAKE,WAKE]’ -----over a thousand entries
How do I extract these text objects in Matlab so I can assign integer values to them?
0 Kommentare
Akzeptierte Antwort
Ankit Kumar
am 23 Okt. 2019
Hi Stewart,
You can extract the different text entries using strsplit(). Refer this for more info,
Then you can convert them into text objects using mlreportgen.dom.Text(), for example:
textObj = mlreportgen.dom.Text('abc');
For more info see this,
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!