Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
siv1
siv1 le 23 Déc 2019
Commenté : Asvin Kumar le 26 Déc 2019
[~,k2]=sort(g,'ascend');
[~,k1]=sort(h,'ascend');
k3=k1+k2;
k=k3/2;
[~,fx_opt]=min(k);
  1 commentaire
Asvin Kumar
Asvin Kumar le 26 Déc 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by