% plot_scalarfunc.m

clear; close all;

[LABEL,DATA] = MBDynLoad('scalarfunc.abs');

X = DATA(:,2,LABEL==1);
Y = DATA(:,2,LABEL==2);

Xd = [-2, -1, 0, 1, 2, 3];
Yd = [0, 0, 0, 1, 1, 1];

figure(1)
plot(X,Y,'-b',Xd,Yd,'ob','LineWidth',1)
grid on;
set(gca,'FontSize',16);
xlabel('x','FontSize',16);
ylabel('f(x)','FontSize',16);
xlim([-3,4])
ylim([-0.2,1.4])