dlmread with Complex Data
Afficher commentaires plus anciens
Hello,
I am trying to load the csv file which is linked to at the end of the post into MATLAB. The file contains 11 lines and 2 columns. The data in the second column is complex. There is no header.
The following code throws an exception
folder = 'C:\Users\...\';
M= csvread([folder '\sweepRect1_4.csv'])
The exception is:
Error using dlmread (line 139)
Mismatch between file and format string.
Trouble reading number from file (row 2u, field 1u) ==>
0.0694068104667148i\n
Error in csvread (line 48)
m=dlmread(filename, ',', r, c);
From reading the documentation on csvread, my understanding is that the file is properly formatted. I have looked at the csv file in notepad and notepad++ and I do not see any extra characters that would be 'non numeric'. My understanding is that the \n is necessary and proper in a csv file. Note, I get this error with csv-files generated by Ansoft's HFSS (on Windows) and never edited by MS Excel. This file was cropped using MS Excel, but the exception is the same.
So, how do I load this file? I need to load several large files, and hand editing the files would be a last resort.
Thank you very much for your time,
Andrew
https://skydrive.live.com/redir?resid=C643CB32E791B631!618&authkey=!AG-2C2QrnBMKWD8
MATLAB Version: 7.14.0.739 OS: Windows 7
Réponse acceptée
Plus de réponses (1)
Andrew
le 25 Juil 2012
0 votes
Catégories
En savoir plus sur Text Files 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!