erratic results while using dlmread function
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Walter Roberson
le 6 Sep 2011
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
le 10 Sep 2011
2 commentaires
Walter Roberson
le 10 Sep 2011
You could, but it would possibly be easier to switch to using textscan() .
Question: are there any negative values in the file?
Voir également
Catégories
En savoir plus sur Text Files dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!