function plog( mu, x0, N, K) %--------------------------------------------------------------------- %plot Summary of this function goes here % Plot N iterations of logistic map with specific growth mu, % initial value x0 and carrying capacity K. %--------------------------------------------------------------------- if nargin < 4 K = 100; end if nargin < 3 N = 50; end if nargin < 2 x0 = 5; end logistic = @(x,m,k) m * x * (1 - x/k); arr0 = zeros(1,N+1); arr0(1) = x0; arr1 = zeros(1,N+1); arr1(1) = x0 * 1.001; for n = 2:N+1 arr0(n) = logistic(arr0(n-1),mu,K); arr1(n) = logistic(arr1(n-1),mu,K); end subplot(2,1,1); plot(0:N,arr0); subplot(2,1,2); plot(0:N,arr1); end