Export values from cell array

4 visualizaciones (últimos 30 días)
Mafalda Couto
Mafalda Couto el 18 de Sept. de 2017
Editada: Walter Roberson el 19 de Sept. de 2017
Hello
I have a txt file that includes events reported during acquisition. This is cell array that has textual data mixed with numerical data. For example:
Events_data [4x1 cell]:
'Acquisition started'
'30mg of XYZ were inserted'
'no response'
'end of acquisiotion'
I mean to export the data from the amount of XYZ used and the row in the array it was recorded (because i mean to associate with other array that includes time of recording). The code I am currently using is:
for n=1:(length(Events_data))
if findstr(char(Events_data{1,4}(n,1)), 'XYZ')>0
Dose(n,1)=sscanf(char(Events_data{1,4}(n*3+1,1)),'%d'); %the error is reported here
end
end
This detects when "XYZ" is declared and searches for any value in that cell. This is working fine for some of the .txt data files however some other are reporting 'Subscripted assignment dimension mismatch.' but all have the same source.
Could the txt files be corrupted or am I doing some mistake?
Thank you

Respuestas (0)

Categorías

Más información sobre Files and Folders 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