Info
此问题已关闭。 请重新打开它进行编辑或回答。
Is anyone can solve a programmable matlab code for connections in Simulink ?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I am adding a small script that create figure Dmux_2_tag(attached):
no_cells = 8;
AddGoto1=zeros(no_cells,1);
PH_AddGoto1=cell(no_cells,1);
Dmux_AddGoto1=zeros(no_cells,1);
%%%handle for Demux:
Dmuxx=find_system(mdl,'LookUnderMasks','All','FindAll','on','Name','Demux');
set(Dmuxx,'Outputs',num2str(no_cells))
PH_Dmuxx=get(Dmuxx,'PortHandles');
%%%N cells by definition --> no_cells.
for l=1:no_cells
nl=num2str(l);
%%%add goto_1:
AddGoto1(l)=add_block('simulink/Signal Routing/Goto', [mdl,'/gmod_1',nl]);
posg = get(AddGoto1(l),'Position');
set(AddGoto1(l),'Position',posg + [200 200*(l-1)-176 215 200*(l-1)-176])
set(AddGoto1(l),'GotoTag',['mod_1',nl]) %%- set tag
%%%get port handle
PH_AddGoto1{l}=get(AddGoto1(l),'PortHandles');
%%%connect Demux to AddGoto blocks PH_Muxx_in
Dmux_AddGoto1(l) = add_line(mdl,PH_Dmuxx.Outport(l),PH_AddGoto1{l}.Inport);
end
I want to change the code to create plot as discribe in figure Dmux_2_mux_tag.
From my understanding, I need to add addition mux declaration to original code and set all the connections...in code..
Is anyone can assist to solve it ?
Thanks, Henry
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!