/** SAS/IML Studio program to show iterations of Fibonacci matrix **/ F = {1 1, 1 0}; /** F = Fibonacci matrix **/ call eigen(val, vect, F); /* create "empty" scatter plot and hide points */ declare ScatterPlot p; p = ScatterPlot.Create("Fibonacci", {-1 12}, {-1 8}); p.ShowObs(false); /* adjust ticks; add grid */ p.SetAxisTickAnchor(XAXIS, 0);p.SetAxisTickUnit(XAXIS, 2); p.ShowReferenceLines(); /* draw eigenvectors */ p.DrawUseDataCoordinates(); do i = 1 to 2; t = vect[,i]*{-5 20}; p.DrawLine(t[1,], t[2,]); end; /* create and plot square of initial conditions */ s = {0 1 1 0 0, 0 0 1 1 0}; /* unit square */ xy = {0, 1.5} + s; /* translation */ p.DrawPolygon(xy[1,], xy[2,], true); /* plot iterates of square */ colors = BLUE || CYAN || OLIVE || ORANGE || RED; do i = 1 to ncol(colors); xy = F*xy; p.DrawSetBrushColor(colors[i]); p.DrawPolygon(xy[1,], xy[2,], true); end;