|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
<P>我定义一个按钮,CALLBACK回调函数为pushapply(),具体代码如下:<BR>function open()<BR>global FileName;<BR>[FileName,PathName]=uigetfile(...<BR>{'*.bmp;*.jpg;*.tif;*.png','IMAGE Files (*.bmp,*.jpg,*.tif,*.png)';<BR> '*.bmp','Bitmap (*.bmp)'; ...<BR> '*.jpg','Joint Photographic Experts Group (*.jpg)'; ...<BR> '*.tif','Tagged Image files (*.tif)'; ...<BR> '*.png','Portable Network Graphics (*.png)'; ...<BR> '*.*','All Files (*.*)'},...<BR> 'file Selector','')<BR><BR> h_axes=axes('position',[0.05,0.15,0.45,0.70],'visible','on'); <BR> imshow(FileName)<BR><BR>h1 = uicontrol(gcf, ... <BR>'style','pushbutton',...<BR>'Callback',['pushapply(FileName)'], ... <BR>'Position',[0.8 0.12 0.12 0.1], ... <BR>'String','Apply', ... <BR>'Tag','Pushapply'); <BR><BR>函数pushapply如下:<BR><BR>function pushapply(FileName)<BR><BR>x1=imread(FileName);<BR>figure,imshow(x1)<BR><BR>运行时出现下面的错误:<BR><BR>??? Undefined function or variable 'FileName'.</P>
<P>??? Error while evaluating uicontrol Callback.<BR><BR>请大家帮我看看这是怎么回事,谢谢了!<BR></P> |
|