Convert equations to MATLAB code

3 vues (au cours des 30 derniers jours)
Tauqeer Nadeem
Tauqeer Nadeem le 18 Mai 2019
Commenté : Walter Roberson le 19 Mai 2019
% Equation 1
Vi(k+1)=w*Vi(k)+c1*r1(Xi,best(k))+c2*r2(Xg,best(k)-Xi(k))
% Equation 2
Xi(k+1)=Xi(k)+Vi(k+1)
% Equation 3
w(k)=wmax-(wmax-wmin)/Niter

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 18 Mai 2019
Modifié(e) : KALYAN ACHARJYA le 18 Mai 2019
Last two equations are already in Matlab form, may be just required (.) dot in equation 3 depending on type of variable (if any vector dot operation).
In first equation best(k) menas?
  6 commentaires
Tauqeer Nadeem
Tauqeer Nadeem le 19 Mai 2019
But how can I write in matlab ? need help on that
Walter Roberson
Walter Roberson le 19 Mai 2019
You already wrote them in MATLAB form, provided that the three conditions I mentioned hold. If any of those three conditions do not hold, you have to tell us more details.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by