声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2122|回复: 2

[GUI界面] 如何保存数据

[复制链接]
发表于 2007-5-20 12:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
如何在gui界面里面保存新生成的数据,最好是能够在界面上直接输入保存的名字
回复
分享到:

使用道具 举报

 楼主| 发表于 2007-5-20 14:15 | 显示全部楼层

具体程序如下

function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

handles=guidata(jiemian);
l=handles.insignal;
prompt={'a1:','a2:','d'};
def={'10','1000','20'};
dlgtitle='choose';
lineno=1;
answer0=inputdlg(prompt,dlgtitle,lineno,def);
a1=str2double(answer0{1});
a2=str2double(answer0{2});
d=str2double(answer0{3});
y=l(a1:a2);
n=length(y);
N=5*n+45;
x1=[50:5:N];
x=x1';
s0=evalin('base','s0')
s1=evalin('base','s1')
if ((s1==0)&&(s0==1))
   pcoef=polyfit(x,y,d);
   xx=50:N;
   yy=polyval(pcoef,xx);
  loglog(x,exp(y),'g',xx,exp(yy),'r') ;
  hold off
elseif((s1==1)&&(s0==0))
   loglog(x,y,'g');
   pcoef=polyfit(x,y,d);
   xx=50:N;
   yy=polyval(pcoef,xx);
  loglog(exp(x),y,'g',exp(xx),yy,'r')
  hold off
elseif((s1==1)&&(s0==1))
   pcoef=polyfit(x,y,d);
   xx=50:N;
   yy=polyval(pcoef,xx);
  loglog(x,y,'g',xx,yy,'r') ;
else
  pcoef=polyfit(x,y,d);
   xx=50:N;
   yy=polyval(pcoef,xx);
   plot(x,y,'g');
   hold on
   plot(xx,yy,'r');
fid = fopen('[path, file.dat]','wt');
fprintf(fid,' %15.12f\n',yy);
fclose(fid);
end
hold off


现在在save目录里面没有办法操作我在其下编的程序如下
fid(function save_Callback(hObject, eventdata, handles)
% hObject    handle to save (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[file,path] = uiputfile('*.dat','Save As');
fid(path, file);
请高手指点一下:handshake :handshake
发表于 2007-5-20 23:11 | 显示全部楼层
原帖由 eric-rzq 于 2007-5-20 14:15 发表
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    struct ...



help save
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-24 09:27 , Processed in 0.067871 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表