bb=val;

hold on;
plot(bb(end:-1:1),'.-')
title('Reverse Scree Graph for SVR with Linear Kernel');
xlabel('Cycle number');
ylabel('Value of the Objective Function');
% legend('n=400','n=200','n=100','Location','northwest');
text(25,0.07,'n=100','EdgeColor','black','FontSize',12);


sample=[100 200 400];
color={'red' 'blue' 'black'};
symbs={'+' '*' '.'};
coef=[1,1,-1,0.5,0.5,];

nonlinear_reg_plot(sample,color,symbs,30,5,2,5)
nonlinear_class_plot(sample,color,symbs,30,5,coef)

% regression
r(j)=plot(val2,'.-','Linewidth',1.5,'MarkerSize',15);
hand{j}=['n=' num2str(sample(j))];
title('Reverse Scree Graph for SVR with Gaussian Kernel','Fontsize',15);
xlabel('Cycle number','Fontsize',15);
ylabel('Value of the Objective Function','Fontsize',15);
ll=legend(r(j),hand{j},'Location','NorthWest');
set(ll,'Fontsize',15);
box off;

% classification
r(j)=plot(val2,'.-','Linewidth',1.5,'MarkerSize',15);
hand{j}=['n=' num2str(sample(j))];
title('Reverse Scree Graph for SVM with Gaussian Kernel','Fontsize',15);
xlabel('Cycle number','Fontsize',15);
ylabel('Value of the Objective Function','Fontsize',15);
ll=legend(r(j),hand{j},'Location','NorthWest');
set(ll,'Fontsize',15);
box off;


