필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
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