N = 1:4; S = 4; L = 1:4; Complexity_N = (N+1).*S.^(1+1); Complexity_L = (1+1).*S.^(L+1); figure; plot(N,Complexity_N) hold on plot(L,Complexity_L) hold off