axislimit_callback.m
上传用户:jspk663
上传日期:2013-08-19
资源大小:232k
文件大小:1k
- function axislimit_callback
- prompt={'Xlimit:','Ylimit:'};
- title='Input parameters';
- lines=[1 1]';
- def={num2str([0 1000]),num2str([-.5 1])};
- answer=inputdlg(prompt,title,lines,def);
- data=get(gcbo,'userdata');
- xlim=str2num(answer{1});
- if ~isempty(xlim)
- set(gca,'xlim',xlim);
- data(1)=xlim(1);
- data(2)=xlim(2);
- end
- ylim=str2num(answer{2});
- if ~isempty(ylim)
- set(gca,'ylim',ylim);
- data(3)=ylim(1);
- data(4)=ylim(2);
- end
- MV=findobj(gcf,'tag','axis');
- set(MV,'userdata',data);
- hold on