Hi Imran,
There are two ways in which you can achieve this and it mainly depends on the variables 't1' and 'y'.
- If 't1' and 'y' are vector of integers and you want to animate plotting each point in the figure, you can follow the procedure in this community post to achieve this. Basically you need to capture each plot as a frame and save all these frames as a gif.
- If the variable 't1' is a symbolic variable that denotes time and variable 'y' can be sybolically represented as a function of 't1', you can create a fanimator object and write the animation using the writeAnimation function. For reference, you can check the examples given in the documentation page of writeAnimation function.
Hope this helps