Rank: 4511 based on 20 downloads (last 30 days) and 2 files submitted
photo

Vijay Swaminathan

E-mail
Lat/Long
42.283, -71.35

Personal Profile:

Vijay Swaminathan is a trainer at The MathWorks. He teaches MATLAB, Simulink, Real Time Workshop and specializes in the area of Signal Processing.

Professional Interests:
signal processing, video and image processing.

 

Watch this Author's files

 

Files Posted by Vijay View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
07 Aug 2013 Screenshot Mix color and black and white in the same picture -custom colormaps This GUI will allow you to take a color image and set regions of it to be black and white. Author: Vijay Swaminathan application, color, image, mixing, mix, black and white 9 0
10 Aug 2009 Screenshot Dealing with array of buses in Simulink® This demo shows a self modifying masked subsystem to split out the correct subbus from the superbus. Author: Vijay Swaminathan self modifying masks, array of buses, building models from ..., self_rating 11 2
  • 4.5
4.5 | 2 ratings
Comments and Ratings by Vijay
Updated File Comments Rating
01 Oct 2009 Dealing with array of buses in Simulink® This demo shows a self modifying masked subsystem to split out the correct subbus from the superbus. Author: Vijay Swaminathan

Hi,

You can indeed set signal properties like”Name” from the command, but the trick is you have to get the handle first. The easiest way to get the handle is through the block whose *outport* is connected to the signal. Do not use the inport of the block that the signal feeds to, as the properties will be read-only there.

Here is a simple example:

1. Open up a demo model called vdp.mdl
2. Let’s say I want to set the name of the signal coming out of the gain block “Mu” to be “blah”.

>> myhandles = get_param('vdp/Mu','PortHandles')

Inport: 2.5270e+003
Outport: 2.5280e+003
Enable: []
Trigger: []
State: []
LConn: []
RConn: []
Ifaction: []

>> set_param( myhandles.Outport,'Name','blah')

You should now see in the model that the signal has been named.

You can use this technique in conjunction with the find_system command to do very powerful things.

Regards,
Vijay

Comments and Ratings on Vijay's Files View all
Updated File Comment by Comments Rating
01 Oct 2009 Dealing with array of buses in Simulink® This demo shows a self modifying masked subsystem to split out the correct subbus from the superbus. Author: Vijay Swaminathan Swaminathan, Vijay

Hi,

You can indeed set signal properties like”Name” from the command, but the trick is you have to get the handle first. The easiest way to get the handle is through the block whose *outport* is connected to the signal. Do not use the inport of the block that the signal feeds to, as the properties will be read-only there.

Here is a simple example:

1. Open up a demo model called vdp.mdl
2. Let’s say I want to set the name of the signal coming out of the gain block “Mu” to be “blah”.

>> myhandles = get_param('vdp/Mu','PortHandles')

Inport: 2.5270e+003
Outport: 2.5280e+003
Enable: []
Trigger: []
State: []
LConn: []
RConn: []
Ifaction: []

>> set_param( myhandles.Outport,'Name','blah')

You should now see in the model that the signal has been named.

You can use this technique in conjunction with the find_system command to do very powerful things.

Regards,
Vijay

29 Sep 2009 Dealing with array of buses in Simulink® This demo shows a self modifying masked subsystem to split out the correct subbus from the superbus. Author: Vijay Swaminathan matlab kid

Good one..Very usefull .
Do you have any script to change the signal names from commandline...?

Contact us