How to load txt to matlab which is got by the fortran.

3 visualizaciones (últimos 30 días)
yu
yu el 22 de Jun. de 2013
my txt format is:
0.987548828125000 (15.0987939173195,0.000000000000000E+000)
1.97509765625000 (5.36979083395557,0.000000000000000E+000)
2.96264648437500 (2.49964765804540,0.000000000000000E+000)
3.95019531250000 (1.43875757499693,0.000000000000000E+000)
The first column is float and second is the complex.
How to load this txt to matlab
Thanks

Respuestas (1)

Walter Roberson
Walter Roberson el 22 de Jun. de 2013
fid = fopen('YourFile.txt', 'r');
datacell = textscan(fid, '%f(%f,%f)');
fclose(fid);
data = [datacell{1}, complex(datacell{2},datacell{3})];

Categorías

Más información sobre Fortran with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by