Dear all ,

I want to have a linear function ,

```
y = f(x,y1,y2,y3)
```

The above function should give the following answers :

```
y = y1 , if x = x1
```

```
y = y2 , if x = x2
```

```
y = y2 , if x = x3
```

The variable, x is an integer variable, which will only take values, x1, x2 and x3.

I can do it when x is binary (0,1) as follows:

```
y = x*y1 + (1-x)*y2
```

this gives,

```
y = y1 , if x = 1
y = y2 , if x = 0
```

But I want to do it for x , taking three / four values.

Please help me in this.

Thanks