フィルターのクリア

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

4 ビュー (過去 30 日間)
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 11 月 26 日
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

回答 (1 件)

Muruganandham Subramanian
Muruganandham Subramanian 2012 年 11 月 30 日
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 件のコメント
V Vaishnavi Kumar
V Vaishnavi Kumar 2012 年 12 月 31 日
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,

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

Community Treasure Hunt

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

Start Hunting!

Translated by