Borrar filtros
Borrar filtros

Problem in importdata function in Matlab version R2014a

1 visualización (últimos 30 días)
abbas hasan
abbas hasan el 2 de Jun. de 2015
Hi
am trying to open a text (sample.txt) file in MATLAB using importdata function. i use matlab version R2014a. when i use importdat it creats a cell variable, and i need a structure, the problem is , that i don't have this problm all time. I am use this function for several text files that contain inside the same information.
for example these the contents inside two different files:
File1:
"Data from BA_Background_00001.txt Node
Date: Mon Jun 01 11:21:08 CEST 2015 User: abc Spectrometer: MAYP112055 Autoset integration time: false Trigger mode: 0 Integration Time (sec): 5.484000E-2 Scans to average: 10 Electric dark correction enabled: true Nonlinearity correction enabled: false Boxcar width: 5 Stray light correction enabled: false XAxis mode: Wavelengths Stop averaging: false Number of Pixels in Spectrum: 2068 >>>>>Begin Spectral Data<<<<< 198.5 177 199 162 199.5 150 200 141 . . . . . . . ."
File 2:
Data from S_MAYP1120552_00001.txt Node
"Date: Mon Jun 01 11:24:04 CEST 2015 User: abc Spectrometer: MAYP112055 Autoset integration time: false Trigger mode: 0 Integration Time (sec): 5.484000E-2 Scans to average: 10 Electric dark correction enabled: true Nonlinearity correction enabled: false Boxcar width: 5 Stray light correction enabled: false XAxis mode: Wavelengths Stop averaging: false Number of Pixels in Spectrum: 2068 >>>>>Begin Spectral Data<<<<< 198.5 187 199 176 199.5 169 . . . . . ."
for the file 1 the importdat function open as struct, but for file 2, it is open as cell.
i dont know where the problem
i very appreciate any help

Respuestas (0)

Categorías

Más información sobre Data Import and Analysis 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