You need to specify the uiaxes to plot into in an app. Otherwise, your plot command will create a new figure window for the plot.
app.h = animatedline(app.UIAxes)
I'd also suggest using app.UIAxes instead of gca. It avoids any potential ambiguity
Another observation. You appear to be plotting your data one value at a time. When you use plot for a single data point, you must specify a marker style or it will not appear in the figure. Also, if you don't specify hold on, each plot command will clear the axes before plotting.
Also, it is recommended to avoid using datenum when possible. You should be able to directly plot using t, which should be a duration. Use xtickformat to set the display format.