How to a store Gaussian Mixture Models in a file ?

I have a cell array of Guassian Mixture Models. I'd like to store and load these models to and from a file. The pseudo-code below shows how I have created a gm_list ( a 1xn array of gaussian models ).
I'd like to use this list in downstream scripts without having to recalculate them.
Can anyone help ?
Thanks,
Adam.
gm_list = cell(1,cluster_count);
for i = 1:cluster_count
cluster_filter = filters(:,i);
L_filter = L( cluster_filter , : );
D = [ L_filter.D1 , L_filter.D2 ];
gm = fitgmdist(D,k') );
gm_list{i} = gm;
end
end

Answers (1)

Why not just save to mat file
save('my_gm_fits.mat', 'gm_list')
and then retreive them when needed
gm_list = load('my_gm_fits.mat', 'gm_list');

Asked:

on 1 Apr 2019

Edited:

on 3 Apr 2019

Community Treasure Hunt

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

Start Hunting!