Hi,
You need to maintain a local variable to keep a count on the number of points already read. Below code demonstrates plotting the graph with next 20 points on clicking next button. "app.Data" is your data and "app.Count" counts the number of points read. Below function is the callback for next button.
function NextButtonPushed(app, event)
x = app.Data(app.Count:app.Count+19,1);
y = app.Data(app.Count:app.Count+19,2);
%passing the axes on which graph is displayed
plot(app.UIAxes,x,y);
app.Count = app.Count + 20;
if app.Count > 100
app.Count = 1;
end
end
Attached the app file for reference. Hope this helps