figure(1)
rvaluesc=rvalues(1:length(alliters));
[hAx,hLine1,hLine2]=plotyy(rvaluesc,alliters,rvaluesc,allranks);
title(sprintf('r values versus: # iterations/max rank; [m n k] fixed at %i,%i,%i ',m,n,k))
xlabel('r values/initial feasible ranks of P')
ylabel(hAx(1),sprintf('# iterations/max per step is %i',iterlimit))
ylabel(hAx(2),'max rank obtained for final P')
legend('y=# iterations','y=max ranks at end')
set(hLine1,'LineStyle','--');
set(hLine1,'Color','g');
set(hLine2,'LineStyle',':');
set(hLine2,'Color','r');
