This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Define component outputs, that is, Physical Signal output ports of block


outputs out1 = { value , 'unit' };  end


outputs begins a component outputs definition block, which is terminated by an end keyword. This block contains declarations for component outputs. Outputs will appear as Physical Signal output ports in the block diagram when the component file is brought into a Simscape™ model. Each output 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 output, out1, as a value with unit. value is the initial value. unit is a valid unit string, defined in the unit registry.

    out1 = { value , 'unit' };

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

    out1 = { value , 'unit' };  % label:location

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.


The following example declares an output port p, with a default value of 1 Pa, specifying the output port of a hydraulic pressure sensor. In the block diagram, this port will be named Pressure and will be located on the bottom side of the block icon.

    p = { 1 'Pa' };   % Pressure:bottom

The next example declares an output port v as a 3-by-3 matrix of linear velocities.

   v = {zeros(3), 'm/s'}; 

See Also



Introduced in R2008b

Was this topic helpful?