# IC

Set initial value of signal

• Library:

## Description

The IC block sets the initial condition of the signal at its input port, for example, the value of the signal at the simulation start time (`tstart`). To do so, the block outputs the specified initial condition when you start the simulation, regardless of the actual value of the input signal. Thereafter, the block outputs the actual value of the input signal.

The IC block is useful for providing an initial guess for the algebraic state variables in a loop. For more information, see Algebraic Loop Concepts.

### Behavior for Nonzero Sample Time Offset

If an IC block has a nonzero sample time offset (`toffset`), the IC block outputs its initial value at time `t`,

`t = n * tperiod + toffset`

where `n` is the smallest integer such that ```t ≥ tstart```.

That is, the IC block outputs its initial value the first-time blocks with sample time ```[tperiod, toffset]``` execute, which can be after `tstart`.

## Ports

### Input

expand all

Input signal, specified as a scalar, vector, matrix, or N-D array. The block sets the initial condition of this signal to the Initial value you specify.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `Boolean` | `fixed point` | `enumerated` | `bus`

### Output

expand all

Output signal provided as the Initial value you specify, followed by the actual values of the input signal. See Behavior for Nonzero Sample Time Offset for more information.

Data Types: `single` | `double` | `int8` | `int16` | `int32` | `int64` | `uint8` | `uint16` | `uint32` | `uint64` | `Boolean` | `fixed point` | `enumerated` | `bus`

## Parameters

expand all

Specify the initial value of the input signal as a finite, real-valued scalar, vector, matrix, or N-D array. The value must be a scalar, or have the same dimensions as the input signal.

#### Programmatic Use

 Block Parameter: `Value` Type: character vector Values: scalar | vector | matrix | N-D array Default: `'1'`

Specify the sample time as a value other than `-1`. For more information, see Specify Sample Time.

#### Dependencies

This parameter is not visible unless it is explicitly set to a value other than `-1`. To learn more, see Blocks for Which Sample Time Is Not Recommended.

#### Programmatic Use

 Block Parameter: `SampleTime` Type: string scalar or character vector Default: `"-1"`

## Block Characteristics

 Data Types `Boolean` | `bus` | `double` | `enumerated` | `fixed point` | `integer` | `single` Direct Feedthrough `yes` Multidimensional Signals `yes` Variable-Size Signals `no` Zero-Crossing Detection `no`

## Version History

Introduced before R2006a