Require a linear function
Posted: Wed Jun 02, 2021 3:19 pm
Dear all ,
I want to have a linear function ,
The above function should give the following answers :
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:
this gives,
But I want to do it for x , taking three / four values.
Please help me in this.
Thanks
I want to have a linear function ,
Code: Select all
y = f(x,y1,y2,y3)
Code: Select all
y = y1 , if x = x1
Code: Select all
y = y2 , if x = x2
Code: Select all
y = y2 , if x = x3
I can do it when x is binary (0,1) as follows:
Code: Select all
y = x*y1 + (1-x)*y2
Code: Select all
y = y1 , if x = 1
y = y2 , if x = 0
Please help me in this.
Thanks