get variables from text file

1 回表示 (過去 30 日間)
Ageliki Vka
Ageliki Vka 2018 年 4 月 27 日
回答済み: Sarah Palfreyman 2018 年 4 月 30 日
Hello!
I have a text file with data from a person who did an experiment. It is attached here. I need to get a vector with the number of every trial. Then I need a cell array that contains all the buttons pressed in that trial, all the timePresses and all the durations. E.g. for that file the trial numbers vector would be : [1 2 7 8 9]. For trial 1 the button would contain: 2 1 2 1, the timePress would contain: 5.6497, 6.6892, 12.3369, 12.7852 and the duration would contain: 0.8395 5.6476 0.4483 6.1118. I imagine we need something like textscan or regular expressions but I don't really know how to use them... Thanks on advance for every advice.
Best,
A.

回答 (3 件)

Ageliki Vka
Ageliki Vka 2018 年 4 月 28 日
Anyone please?

Jeff Miller
Jeff Miller 2018 年 4 月 29 日
GetNumsInAsciiFile (on FileExchange) will get you one long list of numbers, and then you can put them where you like. Maybe that's a start.

Sarah Palfreyman
Sarah Palfreyman 2018 年 4 月 30 日
You can also use Text Analytics Toolbox for this workflow.

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by