找回密码
 注册
Simdroid-非首页
查看: 87|回复: 1

将图片中曲线数据导出并存放在txt文件中

[复制链接]
发表于 2011-12-7 17:46:50 | 显示全部楼层 |阅读模式 来自 黑龙江哈尔滨
本帖最后由 西风独自凉 于 2011-12-7 17:47 编辑

%Samp1_1
dt=0.02;   %采样间隔
f=3;     %频率为3Hz
t=0:dt:5;  %振动持续时间
x=0.5*sin(2*pi*f*t+1);   %信号
plot(t,x)    %绘出信号图
xlabel('时间/s')   %给出横坐标标记
ylabel('振幅')  %给出纵坐标标记
a=get(gca, 'children');
xdata=get(a(1),'xdata');
fid=fopen('my_a.txt','wt');
fprintf(fid,'%12.8f\n',xdata);
fclose(fid);
a=get(gca, 'children');
ydata=get(a(1),'ydata');

fid=fopen('my_b.txt','wt');
fprintf(fid,'%12.8f\n',xdata);
fclose(fid);


发表于 2011-12-19 15:31:39 | 显示全部楼层 来自 台湾
Simdroid开发平台
已经有t, x了
为何不直接save my_a.txt t x -ascii
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-10-3 03:29 , Processed in 0.027124 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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