Azzera filtri
Azzera filtri

How to send data from while loop during each iteration to simulink sub system model

4 visualizzazioni (ultimi 30 giorni)
I am having a while loop in Particle swarm optimization controller (written in embedded matlab code). The controller should send an updated data to the simulink sub system. this updation is done by iterating while loop. Until the while loop finishes i couldnt send the data, I tried with eliminating while loop, but the optimization program has to be iterated some way

Risposte (1)

Muruganandham Subramanian
Muruganandham Subramanian il 30 Nov 2012
while(....)
for (...)
pbest=[...] %no.of data depends on population
gbest=[] %one globally best data
sim('ur model name') %here you can call your simulink model to run by giving input from your global dtata
end
end
  1 Commento
V Vaishnavi Kumar
V Vaishnavi Kumar il 31 Dic 2012
K Sr i ll try, while sending data from that
sim('model name')
,will the embedded block receive data from other model,
Here all the blocks are in single simulink model, plz clear me will the embedded block send signal data to subsystem using same command,
how model name for subsystem could be given,

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by