Hi Yamana,
I understand that you want to plot a piecewise function that takes current simulation time "t" as an input, and gives the required output using the MATLAB function block.
The "Ramp" block can be used with the default block settings in order to feed time "t" as an input to the MATLAB function block. Since the default slope for the output of "Ramp" block is 1, it essentially emulates the function "y = t", so it can act as a source of the current time "t".
Creating a simulink model as shown in the below image will help you model the desired function:
Within the MATLAB function block, make sure the function definition contains the following code:
Below is the output from the scope block when the simulation stop sime is set to 1 second.
The following MathWorks documentation page provides more details about the usage of "Ramp" block in Simulink:
Hope this helps,
Ishaan Mehta