【求助】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’无效,请教如何解决
[ 本帖最后由 Rhent 于 2008-12-16 01:24 编辑 ]
回复 楼主 Rhent 的帖子
global s试试
页:
[1]