How to use libsvm based svm regression model for prediction in simulink ?

2 ビュー (過去 30 日間)
Srikar
Srikar 2016 年 6 月 7 日
回答済み: Ricardo Gualavisi 2016 年 6 月 27 日
Dear Friends and Team, For one of my application, I am required to use libsvm based svm regression prediction model svmpredict in simulink. Currently I tried to achieve it through Simulink library MATLAB Function block, as shown in following code block
function y = fcn(SOC,Curr,Tamb,switch_in)
coder.extrinsic('svmpredict','net','polyvaln','evalin','assignin','mapminmax')
....
switch switch_in
case 1
%'model' is the output structure of svmtrain and svmpredict is
%external function
assignin('base','xtestn',xtestn);
estimate_out = svmpredict(y,xtestn, model);
disp(estimate_out);
estimate_out = 0;
But using this the block goes to somekind of infinite simulation, without keeping track of the time necessary to complete simulation on time.
hence this is causing a stalled simulation at Matlab Function block.
Could anyone help me understand the problem or could anyone suggest me an alternative approach, to achieve the same.
Your help is grately appreciated.

回答 (1 件)

Ricardo Gualavisi
Ricardo Gualavisi 2016 年 6 月 27 日
Have you got any solution for this problem ? It would be very helpful for me. Thanks a lot!!

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by