unable to use statistics and machine learning toolbox block in Simulink

2 ビュー (過去 30 日間)
Imran
Imran 2023 年 7 月 19 日
編集済み: Imran 2023 年 7 月 23 日
Hi,
I wanna use the statistics and machine lerning toolbox blocks in the simulink but when i add that the it is showing that , the variable that is the name of the blick is not exist. and for correcting it, it gives some suggetions like load the file into the base workspace but i dont know which file its asking and where its located. i am shearing the screenshort of that massage

回答 (1 件)

Steven Lord
Steven Lord 2023 年 7 月 19 日
You're using this block. From that documentation page: "Import a trained regression object into the block by specifying the name of a workspace variable that contains the object." You need to specify the name of a trained regression object (created using a function like fitrlinear) that is in the workspace. See the "Create Simulink Model" section of the example included on that block's documentation page for a picture of how to create that regression object and specify it as a property of that block.
  3 件のコメント
Steven Lord
Steven Lord 2023 年 7 月 22 日
The first section of this example contains code that defines a variable named linearMdl which, as the example states, is a RegressionLinear object. The second section creates a Simulink model with the block you're trying to use in it. If you double-click on that block the Block Parameters dialog box shown in the example opens up.
In the text box where the picture shows the word linearMdl, right next to "Select trained machine learning model", is where you'd type the name of the model variable that you had created in your workspace.
Imran
Imran 2023 年 7 月 23 日
編集済み: Imran 2023 年 7 月 23 日
thank you sir, this problem of "veriable doesnot exist " is resolved. but another problem came,whaen i am using that block then it shows
Error:Error in port widths or dimensions. 'Output Port 1' of 'untitled/RegressionLinear Predict/Reshape' is a [1x1] matrix.
Error:Error in port widths or dimensions. 'Input Port 1' of 'untitled/RegressionLinear Predict/getScore' is a [1x1000] matrix. how to correct it. i aslo went to the mathworks side but i did not get any thing so please provid me some steps

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSupport Vector Machine Regression についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by