---
url: /dyad/stable/stdlib/DiscreteComponents/components/Examples.Selector.md
description: Dyad Examples.Selector docs.  DiscreteComponents.Examples.Selector()
---

# `Examples.Selector` {#Examples.Selector}

## Usage {#Usage}

`DiscreteComponents.Examples.Selector()`

## Parameters: {#Parameters:}

|    Name | Description | Units | Default value |
| -------:| -----------:| -----:| -------------:|
|    `nu` |             |     – |             1 |
| `index` |             |     – |             1 |

## Connectors {#Connectors}

* `u` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
y\left( t \right) &= u\_{1}\left( t \right)
\end{align}
$$

## Source {#Source}

```dyad
component Selector
  u = [Dyad.RealInput() for i in 1:nu] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  y = Dyad.RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter nu::Integer = 1
  structural parameter index::Integer = 1
relations
  y = u[index]
end
```

```dyad
component Selector
  u = [Dyad.RealInput() for i in 1:nu] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  y = Dyad.RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter nu::Integer = 1
  structural parameter index::Integer = 1
relations
  y = u[index]
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
