I am new to Matlab.
I want to save a mat to table files. I have a mat file like this. There is 1* 55 struct, which was stored in “data” field. the data structure of the table
I want to save the “track” field in these structs. And my code:
data = load('G:/my_file.mat');
my_output_file = 'G:/my_output.txt'
for my_track_data = data.data.track
writetable(my_track_data, my_output_file)
end
But there is a error:
Expected one output from a curly brace or dot indexing expression, but there 55 results.
by the way, I can see the Matlab displayed all the results when I type: ''' data.data.track '''
All the 55 tables in the "data.data.track"
I tried just save it without a loop:
my_track_data = data.data.track
writetable(my_track_data, my_output_file)
It only save just the first table.