Skip to Main Content Skip to Search
Product Documentation

getlinio - Linearization input/output (I/O) settings for Simulink model, Linear Analysis Plots or Model Verification block

Syntax

io = getlinio('sys')
io = getlinio('blockpath')

Alternatives

As an alternative to the getlinio function, view linearization I/Os in the:

Description

io = getlinio('sys') finds all linearization inputs/outputs (I/Os) in the Simulink model, sys, and returns a vector of objects, io. Each object represents a linearization annotation in the model and is associated with an output port of a Simulink block. Before running getlinio, use the right-click menu to insert the linearization annotations, or I/Os, on the signal lines of the model diagram.

io = getlinio('blockpath') finds all I/Os in a Linear Analysis Plots or Model Verification block. blockpath is the full path to the block. io is a vector of objects and has an entry for each linearization port used by the block.

Each object within the vector, io, has the following properties:

Active

Set this value to 'on', when the I/O is used for linearization, and 'off' otherwise

Block

Name of the block with which the I/O is associated

OpenLoop

Set this value to 'on', when the feedback loop at the I/O is open, and 'off', when it is closed

PortNumber

Integer referring to the output port with which the I/O is associated

Type

Choose one of the following linearization I/O types:

  • 'in': linearization input point

  • 'out': linearization output point

  • 'outin': linearization output then input point

  • 'inout': linearization input then output point

BusElement

Bus element name with which the I/O is associated. Empty string ('') if the I/O is not a bus element.

Description

String description of the I/O object

You can edit this I/O object to change its properties. Alternatively, you can change the properties of io using the set function. To upload an edited I/O object to the Simulink model diagram, use the setlinio function. Use I/O objects with the function linearize to create linear models.

Examples

Find linearization inputs/outputs in a Simulink model.

Before creating a vector of I/O objects using getlinio, you must add linearization annotations representing the I/Os, such as input points or output points, to 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 input point on this signal line.

    A small arrow pointing toward a small circle just above the signal line represents the input point.

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

    A small arrow pointing away from a small circle just above the signal line represents the output point.

  4. Create a vector of I/O objects for this model.

    io=getlinio('magball')
    

    This syntax returns a formatted display of the linearization I/Os.

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

    io is a vector with two entries representing the two linearization annotations previously set in the model diagram. MATLAB also displays:

    • The linearization I/O type (input or output)

    • Whether the IO is a loop opening

    • Block name associated with the I/O

    • Port number associated with the I/O

    By default, the I/Os have no loop openings. Display the properties of each I/O object in more detail using the get function.

 

This example shows how to find linearization inputs/outputs in a Linear Analysis Plots block to update the I/Os.

  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 | linearize | linio | set | setlinio

  


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