Code covered by the BSD License  

Highlights from
Digital Karma: State Graphing

image thumbnail
from Digital Karma: State Graphing by Aman Siddiqi
Evolutionary Simulation, Interaction Graph

crop.m
if currentlyselecting==1;
    if dimension==1;
        croptoprow=selectedoriginrow2; cropbottomrow=selectedendrow2;
        cropfirstcol=selectedorigincol2; croplastcol=selectedendcol2;
        run save_undo;
        a=a(croptoprow:cropbottomrow,cropfirstcol:croplastcol);
        run computeiterations; currentiteration=0; currentlyselecting=0;
        run opening_iteration; run CA_Display;
    elseif dimension==2;
        croptoprow=selectedoriginrow2; cropbottomrow=selectedendrow2;
        cropfirstcol=selectedorigincol2; croplastcol=selectedendcol2;
        cropiterationsfirst=selectedoriginiteration2; cropiterationslast=selectedenditeration2;    
        run save_undo;
        a=a(croptoprow:cropbottomrow,cropfirstcol:croplastcol,cropiterationsfirst:cropiterationslast);
        run computeiterations; currentiteration=0; currentlyselecting=0;
        run opening_iteration; run CA_Display;
    end;
else; errordlg('Select Area to be Cropped','Error');
end;

Contact us at files@mathworks.com