From: Erik-Jan Boonen on 30 Jun 2010 04:57 "Steve Conahan" <sconahan(a)mathworks.com> wrote in message <bi5bm0$hmj$1(a)fred.mathworks.com>... > Hi Paul, > > You may need to write an M function in order to do this (to change the > variable name of the To Workspace logging variable underneath the subsystem > block implementation when your block is copied). One way is to parse the > name of the variable and add a number to it. The get_param function on the > block handle (using gcbh) under the subsystem and string manipulation in M > should do it. > > After you have an M file that will do this, then you need to set your > subsystem block's 'CopyFcn' parameter to that M function name so that it can > be called when the block is copied. To do this, open your library, unlock > the library, select your subsystem block, set your library block's CopyFcn > parameter using the following on the M command line: > > library_block_handle = gcbh; > set_param(library_block_handle,'CopyFcn','your_m_function_name') > > Then re-save the library... > > Cheers, > Steve Hello, Can someone explain this further I am not able to write the M function/code. I made a test model with the name "test". Added a masked subsystem (name DE_B_1) with 3 To Workspace blocks underneath. Now I would like that the parameter/variable names of the To Workspace blocks change when I copy the masked subsystem, which is named automatically to DE_B_2. The To Workspace variables are named like data_A_1. So after the copy I would like to see that the To Workspace variable is named data_A_2. Regards, Erik-Jan
|
Pages: 1 Prev: Simulation time Next: Improving the condition number of rectangular matrix |