Help with Dataread and textread error
12 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Walter Roberson
2020 年 7 月 16 日
I would suspect you have an off-by-one error in calculating numrow, or alternately that your numskip is one too large.
dpb
2020 年 7 月 16 日
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...
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Workspace Variables and MAT Files についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!