Rank: 2335 based on 34 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
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 15 2
  • 4.5
4.5 | 2 ratings
03 Apr 2008 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 browse an image in ma..., black and white, mix, gray, image, mixing 19 0
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...?

Top Tags Applied by Vijay
antique, application, array of buses, black and white, building models from the command line
Files Tagged by Vijay View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
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 15 2
  • 4.5
4.5 | 2 ratings
03 Apr 2008 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 browse an image in ma..., black and white, mix, gray, image, mixing 19 0
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com