Export values from cell array

4 次查看(过去 30 天)
Mafalda Couto
Mafalda Couto 2017-9-18
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Files and Folders 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by