Skip to Main Content Skip to Search
Product Documentation

setlinio - Assign linearization input/output settings to Simulink model, Linear Analysis Plots or Model Verification block

Syntax

oldio = setlinio('sys',io)
oldio = setlinio('blockpath',io)

Alternatives

As an alternative to the setlinio function, edit linearization I/Os using the:

Description

oldio = setlinio('sys',io) assigns the settings in the vector of linearization input/output (I/O) objects, io, to the Simulink model, sys. These settings appear as annotations on the signal lines. Use the function getlinio or linio to create the linearization I/O objects. You can save I/O objects to disk in a MAT-file and use them later to restore linearization settings in a model.

oldio = setlinio('blockpath',io) assigns the settings in io as the linearization I/Os in a Linear Analysis Plots or Model Verification block. blockpath is the full path to the block.

Examples

This example shows how to assign linearization input/output settings to a Simulink model.

Before assigning I/O settings to a Simulink model using setlinio, you must create a vector of I/O objects representing linearization annotations, such as input points or output points, on a Simulink model.

  1. Open a Simulink model.

    magball
    
  2. Right-click the signal line between the Magnetic Ball Plant and the Controller. Select Linearization Points > Input Point from the menu to place an output point on this signal line. Notice a small arrow pointing away from a small circle just above the signal line. This arrow represents the output point.

  3. Right-click the signal line after the Magnetic Ball Plant. Select Linearization Points > Output Point from the menu to place another output point on this signal line.

    The model diagram should now look similar to that in the following figure:

  4. Create an I/O object with the getlinio function:

    io=getlinio('magball')
    
  5. Modify io by editing the object or by using the set function.

    io(1).Type='in';
    io(2).OpenLoop='on';
    
  6. Assign the new settings in io to the model.

    oldio=setlinio('magball',io)
    

    This assignment returns the old I/O settings (that have been replaced by the settings in io).

     2x1 vector of Linearization IOs: 
    --------------------------
    1. Linearization input located at the following signal:
    - Block: magball/Controller
    - Port: 1
    
    2. Linearization output located at the following signal:
    - Block: magball/Magnetic Ball Plant
    - Port: 1

The model diagram now looks similar to the following figure.

 

Update linearization input/output settings in a Linear Analysis Plots block

This example shows how to update linearization input/output settings in a Linear Analysis Plots block.

  1. Open the watertank model, and specify input and output (I/O).

    1. Right-click the Desired Water Level output signal, and select Linearization Points > Input Point.

    2. Right-click the Water-Tank System output signal, and select Linearization Points > Output Point.

    The linearization I/O markers appear in the model, as shown in the next figure.

    Alternatively, you can use linio.

  2. Drag and drop a Bode Plot block from the Simulink Control Design Linear Analysis Plots library into the model window.

  3. Find all I/Os used by the Bode Plot block.

    io = getlinio('watertank/Bode Plot')

    When you drag and drop the block, the block I/Os are set to the model I/Os. The following results appear at the MATLAB prompt:

    2x1 vector of Linearization IOs: 
    --------------------------
    1. Linearization input located at the following signal:
    - Block: watertank/Desired  Water Level
    - Port: 1
    
    2. Linearization output located at the following signal:
    - Block: watertank/Water-Tank System
    - Port: 1
  4. Open the loop specified by the block I/Os.

    io(2).OpenLoop = 'on';

      Note   The loop opening does not affect the model I/Os.

  5. Update the I/O in the Bode Plot block.

    oldio = setlinio('watertank/Bode Plot',io)

See Also

get | getlinio | linio | set

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS