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

조회 수: 1 (최근 30일)
Chiara Mazzocconi
Chiara Mazzocconi 2018년 4월 13일
답변: Von Duesenberg 2018년 4월 13일
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';
trialfilename=studyfilename
[ objnumber, objname, objtype ] = textread(trialfilename,'%d %s %d');
%%%%%%% ERROR %%%%%%%%%%%%
trialfilename =
'studylist4.txt'
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!!
Chiara

답변 (1개)

Von Duesenberg
Von Duesenberg 2018년 4월 13일
myTable = readtable('studylist4.txt');

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by