matlab gui edit中数据保存成txt并放入任意文件夹

如题所述

第1个回答  2012-05-09
A=str2num(get(handles.edit1,'string'));
cd('C:\');%保存的路径
save A.txt -ascii;追问

还是有错误,你能帮我看看这样的程序吗?callback = ['str=get(eh,''string'');','fh=fopen(''test.txt'',''w'');',...
'fwrite(fh,str);','fclose(fh);'];
figure
global eh;
eh = uicontrol( 'style','edit',...
'string','Input','position',[20 150 150 20]);
uicontrol( 'style','pushbutton',...
'string','保存',...
'callback',callback);

第2个回答  2012-05-09
不懂,来占个位
相似回答