Check out example codes for "display sequence in matlab". It will help you in understanding the concepts better.

Code Example 1

function displaySequence(X,Y)
clrOrder = get(gca,'ColorOrder');
classNames = categories(removecats(Y));
grps = findgroups(Y);
gscatter(1:length(X),X,grps,clrOrder(1:3,:))
legend(classNames)
xlabel('Time (samples)')
ylabel('')
end

Learn ReactJs, React Native from akashmittal.com