Quantcast

Documentation Center

  • Trial Software
  • Product Updates

inputs

Define component inputs, that is, Physical Signal input ports of block

Syntax

inputs in1 = { value , 'unit' }; end  

Description

inputs begins a component inputs definition block, which is terminated by an end keyword. This block contains declarations for component inputs. Inputs will appear as Physical Signal input ports in the block diagram when the component file is brought into a Simscape™ model. Each input is defined as a value with unit, where value can be a scalar, vector, or matrix. For a vector or a matrix, all signals have the same unit.

Specifying an optional comment lets you control the port label and location in the block icon.

The following syntax defines a component input, in1, as a value with unit. value is the initial value. unit is a valid unit string, defined in the unit registry.

inputs
    in1 = { value , 'unit' };
end

You can specify the input port label and location, the way you want it to appear in the block diagram, as a comment:

inputs
    in1 = { value , 'unit' };  % label:location
end

where label is a string corresponding to the input port name in the block diagram, location is one of the following strings: left, right, top, bottom.

Examples

The following example declares an input port s, with a default value of 1 Pa, specifying the control port of a hydraulic pressure source. In the block diagram, this port will be named Pressure and will be located on the top side of the block icon.

inputs
    s = { 1 'Pa' };   % Pressure:top
end

The next example declares an input port I as a row vector of electrical currents. The three signals have a default value of 1 A. The signal initial values may be different, but the unit has to be the same.

 inputs
   I = { [1 1 1], 'A'}; 
 end

See Also

nodes

outputs

Was this topic helpful?