Is this code(in mat lab function block) correct for the attached logic?

1 Ansicht (letzte 30 Tage)
siv1
siv1 am 23 Dez. 2019
Kommentiert: Asvin Kumar am 26 Dez. 2019
[~,k2]=sort(g,'ascend');
[~,k1]=sort(h,'ascend');
k3=k1+k2;
k=k3/2;
[~,fx_opt]=min(k);
  1 Kommentar
Asvin Kumar
Asvin Kumar am 26 Dez. 2019
Looks good.
Please note that MATLAB uses 1-based indexing while you require 0-based indexing. However, this won't affect the output of fx_opt because all values are off-shifted by 1.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by