MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   【求助】GUI中的popumenu如何传递参数 (https://www.labfans.com/bbs/showthread.php?t=5867)

Rhent 2008-12-16 15:27

【求助】GUI中的popumenu如何传递参数
 
在popupmenu的callback下的程序段:
val = get(hObject,'Value');
switch val
case 1
fid3=fopen('youth.txt','rt');
s=fscanf(fid3,'%c');
fclose(fid3);
set(handles.pushbutton6,'string',s);
case 2
fid3=fopen('Going Home.txt','rt');
s=fscanf(fid3,'%c');
fclose(fid3);

case 3
fid3=fopen('Thoughts for a new year.txt','rt');
s=fscanf(fid3,'%c');
fclose(fid3);
case 4
fid3=fopen('Relish the Moment.txt','rt');
s=fscanf(fid3,'%c');
fclose(fid3);
end
guidata(hObject,handles);

结果在其他函数中引用‘s’无效,请教如何解决


所有时间均为北京时间。现在的时间是 11:26

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.