How to convert nested structure to contain its original data?
3 次查看(过去 30 天)
显示 更早的评论
I'm new, and I need some help. So I have these multiple signals in double, .mat format and I managed to load them all as output using this simple code. And I want to further analyze this dataset.
But the output sets the values as struct, which doesn't allow me to conduct batch processing such as feature extraction on it, or import it in the Diagnostic Toolbox.
I want the data in the cell array to be as double, not struct. May I know how to solve this? Or it is bc there's something with my data?
9 个评论
Jan
2021-4-15
"in another set of array/table" - please do not let the reader decide, if you want a table or array. This is your decision.
采纳的回答
Jan
2021-4-15
myFolder1 = ('C:\Users\User\Documents\Signals');
mysignals = dir(fullfile(myFolder1, '**', '*.mat'));
N = numel(mysignals);
mydata = cell(N,1);
for k = 1:N
File = fullfile(mysignals(k).folder, mysignals(k).name);
Data = load(File);
mydata{k} = Data.P2V1; % Or P2V3 or what ever?
end
4 个评论
Jan
2021-4-15
All we need to knwo for the solution is the name of the variable stored in the MAT file. Replace my "P2V1" by the name of this field. I've written "or what ever" in the hope, that you can adjust it accordingly.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!