Too many output arguments. Requested 3 output(s), but only 1 output(s) available.

14 ビュー (過去 30 日間)
function cost_value=cost_func(k,plotfig)
ke=k(1,1);
kce=k(1,2);
ku=k(1,3);
X=k(1,4);
z_a=abs(k(1,5));
v_a=abs(k(1,6));
% negative big
NB=-X;
% negative medium
NM=-X/2;
% positive medium
PM=X/2;
% positive big
PB=X;
Z=0;
% Compute function value
opt = simset('solver','ode23tb','SrcWorkspace','Current');
[tout,xout,yout] = sim('ACO_TS.slx',[0 0.5],opt);
% compute the fitness value
z1=sqrt(mean(rmse)); % rms error
z2=(mean(iae)); % integral absolute error
z3=(mean(itae)); % integral time multiplied absolute error
z4=(mean(ise));
cost_value=z1+z2+z3+z4+mean(thd1);
Error using cost_func
Too many output arguments. Requested 3 output(s), but only 1 output(s) available.
Error in ACO (line 58)
cost(A)=cost_func(tour_selected_param,0); - Show complete stack trace
  5 件のコメント
Sahithi Kandhukuri
Sahithi Kandhukuri 2024 年 1 月 7 日
No the issue is not yet resolved. I am unable to find optimal gain values.
Sam Chak
Sam Chak 2024 年 1 月 7 日
Can you count the number of output(s) available in your Simulink model? Perhaps you requested these three outputs (in individual vectored data form) from the Simulink model in the cost_func() function, but it's possible that you consolidated all the data into a single simulation output object named 'out', as pointed out by @Walter Roberson.
If you are unfamiliar with the object-oriented programming (the dot notation stuff), then better configure the Simulink model to log the requested data as tout, xout, yout, rmse (incorrect!), ise, iae, and itae.

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

採用された回答

madhan ravi
madhan ravi 2024 年 1 月 7 日
You expect three outputs to be returned from sim() whereas only one output can be returned from sim() command
  13 件のコメント
madhan ravi
madhan ravi 2024 年 1 月 8 日
Sorry my goal was to clear all the errors as stated in your original question. Regarding the correctness of your question , it"s better you post a new question.
Sahithi Kandhukuri
Sahithi Kandhukuri 2024 年 1 月 8 日
Ok @madhan ravi thank you so much for your support

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 1 月 7 日
I suspect that your model has been configured to return a single output;

カテゴリ

Help Center および File ExchangeManual Performance Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by