erratic results while using dlmread function
5 ビュー (過去 30 日間)
古いコメントを表示
HI I am using dlmread function to take specific data from .txt file. My data contains 10 text lines(rows) then set of numerical data of size 8 rows and 17 columns I want element at position 17th row(including first 10 text lines) and 14th column. So I used command like: a= dlmread('file name', '', [16 13 16 13]) But its showing error as mismatch in file format and string. When I just modified column number and entered command as a= dlmread('file name', '', [16 15 16 15] Its takes input of element from 17th row and 16th column(as expected) and does not show any error. Thus I found that when I enter columns less that 15 its showing error but for columns greater than 15 it works well. What may be the problem in this case?? Please reply soon. Urgent help is needed.
0 件のコメント
回答 (2 件)
Walter Roberson
2011 年 9 月 6 日
Tips
All data in the input file must be numeric. dlmread does not read files that contain nonnumeric data, even if the specified rows and columns contain only numeric data.
Your 10 text lines of headers are creating problems. You cannot use dlmread() for that file.
(I would speculate that if you examine your text headers, you will find that the longest header has 15 columns.)
Nikhil CD
2011 年 9 月 10 日
2 件のコメント
Walter Roberson
2011 年 9 月 10 日
You could, but it would possibly be easier to switch to using textscan() .
Question: are there any negative values in the file?
参考
カテゴリ
Help Center および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!