Returning workspace outputs is supported with only single return argument

5 ビュー (過去 30 日間)
Joe Jones
Joe Jones 2022 年 8 月 24 日
回答済み: Suman 2024 年 7 月 26 日
Dear,
I am trying to run a simulink model in m-code while optimizing ADRC parameters with PSO, but I get an error:
‘Returning workspace outputs is supported with only single return argument’.
The first figure is 'PSO_ADRC' code and the second figure is the simulink model 'ADRC_test'.
Hope someone can help me, thanks.

回答 (1 件)

Suman
Suman 2024 年 7 月 26 日
Hi Joe,
The problem lies with the way you are using sim() function in your code. sim() function can only return a single argument.
The single output from the sim function will contain the properties that you are trying to return. So you can first get the sim output in a single variable and then access and return those propertiy values.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by