Extracted Features in .MAT files
4 ビュー (過去 30 日間)
古いコメントを表示
Hi.
I want to save the extracted features after signal processing to feed into classifier. For example, I have mean, standard deviation and one other coefficient as extracted features. How can I save them in .mat files? I should save it together or independently?
Thank you.
4 件のコメント
Guillaume
2019 年 4 月 1 日
編集済み: Guillaume
2019 年 4 月 1 日
I am having a total of 128 samples of data and for each sample, three different features have been extracted from each sample
Presumably, you end up with just one variable, an array of 128 arrays of 3 features. So you would just save that in a mat file. If you end up with 128 different variables, then you've gone wrong, and we need to fix that part of your code.
採用された回答
Guillaume
2019 年 4 月 1 日
It's hard to give you proper code without knowing the exact code you're using. It would go something like this:
samplesignals = {???}; %No idea what you're starting with. Here I am assuming a cell array of signals
featurevectors = cell(size(samplesignals)); %could also use a 2d matrix instead of a cell array
for sampleidx = 1:numel(samplesignals) % iterate over the signals
featurevectors{sampleidx} = yourfeaturefunction(samplesignals{sampleidx});
end
save('somefile.mat', 'featurevectors');
2 件のコメント
Guillaume
2019 年 4 月 1 日
Well, it'd be more or less the same code. Again, rough outline since you haven't given specifics.
Here I'm storing your feature vectors in a 128x3 matrix, which I then convert into a table.
samplesignals = {???}; %No idea what you're starting with. Here I am assuming a cell array of signals
numfeatures = 3;
featurevectors = zeros(numel(samplesginals), numfeatures);
for sampleidx = 1:numel(samplesignals) % iterate over the signals
featurevectors(sampleidx, :) = yourfeaturefunction(samplesignals{sampleidx}); %assuming it returns a 3 element vector
end
featurevectors = array2table(featurevectors, 'VariableNames', {'mean', 'std', 'corrcoeff'});
save('somefile.mat', 'featurevectors');
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!