Clear Filters
Clear Filters

How to read a txt table for selecting stimuli...?

4 views (last 30 days)
Hi every body! I'm a beginner and very embarrassed to need help...!! I'm preparing an experiment where I have to play videoclips in a randomised order according to their type... I'm having issue reading the table where the filenames and their category is written...
I attach my table...! and I paste the bit of the script that I think is relevant (please if it's not enough let me know!!) and error that occurs..!
%%%%bit of code that I think is relevant%%%%%%%%
studyfilename = 'studylist4.txt';
[ objnumber, objname, objtype ] = textread(trialfilename,'%d %s %d');
%%%%%%% ERROR %%%%%%%%%%%%
trialfilename =
Error using dataread Trouble reading integer from file (row 1, field 1) ==>
Error in textread (line 168) [varargout{1:nlhs}]=dataread('file',varargin{:}); %#ok<REMFF1>
Error in fnirstrying (line 95) [ objnumber, objname, objtype ] = textread(trialfilename,'%d %s %d');
Error in run (line 91) evalin('caller', strcat(script, ';'));
Please give me a hand!
Thanks a lot in advance!!

Answers (1)

Von Duesenberg
Von Duesenberg on 13 Apr 2018
myTable = readtable('studylist4.txt');

Community Treasure Hunt

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

Start Hunting!