From: Sergio Karpov on 8 Mar 2010 09:26 Hallo, I try to create a Simulink model for a Bus Communication: I use a Bus Creator for the inputs, then i connect the output from the Bus Creator with a other Bus Selectro. Now i need to change the number of the outputs of the Bus Selector, by a default it s 3. How can i change it from the m-script? In Simulink i would simple select "Signals in the Bus" and push them in the selected signals. here is the code: add_block('built-in/BusCreator', 'test/P_box/Bus','Position',[ 300 300 305 450] , 'Inputs','10'); add_block('built-in/BusSelector', 'test/P_box/Bus_out','Position',[ 400 300 405 450]); add_line('test/P_box', 'Bus/1','Bus_out/1'); After I connect both buses I need to set_param() ... Does anyone know how would it be? Thanks
From: Rakesh Bose on 8 Mar 2010 10:54 Hi sergio, use set_param(path,'OutputSignals','sig1,sig2,sig3,...sign'), where 'path' is the path to the bus selector... cheers, rakesh
|
Pages: 1 Prev: m-script, Bus Selectro, change the number of Output Next: script saved as library function! |