フィルターのクリア

How to convert a struct to an object?

6 ビュー (過去 30 日間)
Hewitt
Hewitt 2015 年 1 月 22 日
回答済み: Raghava S N 2024 年 10 月 4 日 7:29
I am having a Gaussian mixture model data in the form of struct with all the parameters identical to that of the GMM object. How to convert this struct to object?

回答 (1 件)

Raghava S N
Raghava S N 2024 年 10 月 4 日 7:29
Hi,
A “gmdistribution” model object can be created using the “gmdistribution” function by specifying the distribution parameters. Refer to this link for more information about the “gmdistribution” function - https://www.mathworks.com/help/stats/gmdistribution.html#d126e598736.
Here is a sample command to create a “gmdistribution” object, assuming the struct that stores the GMM’s parameters is called “gmmStruct” and the parameters are “gmmStruct.mu”, “gmmStruct.Sigma”, “gmmStruct.ComponentProportion”.
gmmObject = gmdistribution(gmmStruct.mu, gmmStruct.Sigma, gmmStruct.ComponentProportion);

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by