Help with Dataread and textread error

12 visualizaciones (últimos 30 días)
Monika Chaulagain
Monika Chaulagain el 15 de Jul. de 2020
Comentada: dpb el 16 de Jul. de 2020
I'm a beginner with matlab and i'm trying to do power spectrum analysis with a txt file and this is the error that i'm receiving, please help me understand it.
Error using dataread
Trouble reading integer from file (row 21620, field 1) ==>
Error in textread (line 171)
[varargout{1:nlhs}]=dataread('file',varargin{:}); %#ok<REMFF1>
Error in ReadSpectraVSplots (line 46)
=
textread(fnameFFT,'%d%s%s%s%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f',numrow,'headerlines',numskip);
>>
  6 comentarios
Walter Roberson
Walter Roberson el 16 de Jul. de 2020
I would suspect you have an off-by-one error in calculating numrow, or alternately that your numskip is one too large.
dpb
dpb el 16 de Jul. de 2020
Again, if want somebody to fix the format string and/or show specifics for textscan or another non-deprecated function to replace textread, attach (a section of) the data file so can see what's actually there.
It's probably too large to do whole thing as text, just select first/last pages in editor and paste them into another file would be more than enough...

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by