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

save_jpg.m
savingpath=uigetdir;
timenow=num2str(datestr(now,30));
current_time_date = ['Pic_',num2str(timenow(1,10:11)),'.', num2str(timenow(1,12:13)),'.', num2str(timenow(1,14:15)),'__', num2str(timenow(1,5:6)),'.', num2str(timenow(1,7:8)),'.', num2str(timenow(1,1:4)),'.','jpg'];
current_time_date = {current_time_date}; %changes current_time_date to a cell for inputdlg
savingname=(inputdlg('','Save As',1,current_time_date));
savingname=savingname{1}; %converts savingname from a cell to a variable for Save
savingname=[savingpath,'\',savingname];
if  save_jpg_option==1;
    currentframeimage = getframe; % just graph
elseif save_jpg_option==2;
    currentframeimage = getframe(gcf); %entire figure
end;
imwrite(currentframeimage.cdata, savingname,'jpg');

Contact us at files@mathworks.com