I have to read this txt file:
#Acceleration force along the x y z axes (including gravity).
#timestamp(ns),x,y,z(m/s^2)
#Datetime: 05/07/2013 11:27:39
##########################################
#Activity: 12 - BSC - Back sitting chair - 10s
#Subject ID: 1
#First Name: sub1
#Last Name: sub1
#Age: 32
#Height(cm): 180
#Weight(kg): 85
#Gender: Male
##########################################
@DATA
2318482693000, 0.89064306, -9.576807, -0.019153614 2318492108000, 0.91937345, -9.595961, -0.05746084 2318503365000,
0.8714894, -9.595961, -0.05746084 2318512831000, 0.8523358, -9.643845, -0.038307227 2318523222000, 0.8714894, -9.634268, -0.05746084 2318533156000, 0.90979666, -9.634268, -0.019153614 2318553207000,
0.9672575, -9.634268, -0.009576807 2318563306000, 0.93852705, -9.672575, -0.009576807 2318575332000, 0.9672575, -9.682152, -0.009576807 2318584933000, 0.9672575, -9.662998, -0.009576807 2318595971000, 0.9576807, -9.634268, 0.009576807
And I have to save numbers after the word "@DATA" in a vector. I don't know how to read a txt file from a certain word (in this case @DATA).
something like
fid = fopen('yourfile.extension');
while ~feof(fid)
tline = fgetl(fid);
disp(tline) %just for debugging purposes
if strncmp("@DATA",tline,5)
break
end
end
while ~feof(fid)
%start reading your data with fscanf for example
end
And never forget your search engine is your friend...
https://fr.mathworks.com/help/matlab/characters-and-strings.html
https://fr.mathworks.com/help/matlab/ref/feof.html
https://fr.mathworks.com/help/matlab/ref/fscanf.html