Problem with dlmread reading data
Afficher commentaires plus anciens
Dear Mathworks community,
I am having a problem using the dlmread function. I want to read data from a GNU zipped file (gravitational data from the GRACE satellite) into MATLAB so I can work with it. This is my approach so far:
MyFolderInfo = dir('C:\Users\my\Desktop\Skole\6. Semester\Bachelor_Projekt\GRACE')
listing = MyFolderInfo(4).name
M = dlmread(listing,' ', [8, 0, 5150, 9])
So I am succesfully loading the data from dir, but when I want to use the dlmread function I get the following error:
*Error using dlmread (line 147)
Mismatch between file and format character vector.
Trouble reading 'Numeric' field from file (row number 1, field number 1) ==> GRCOF2 0 0 0.883194575888E-11
0.000000000000E+00 0.0000E+00 0.0000E+00 20020405.0000 20020501.0000 nnnn \n*
I want to use only the numerical data and exclude the columns "GRCOF2" and "nnnn", but when I try to make the row and column offset, like below, i just get the following error.
M = dlmread(listing,' ', [8, 1, 5150, 8])
Trouble reading 'Numeric' field from file (row number 1, field number 16) ==> nnnn \n
Its almost as it doesn't register my max. column offset correctly. Can anyone help me?
Best Regards Jonathan
PS. I've attached an image of data file that I want to work with in this question, if that helps. It's opened in notepad++.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!