- 积分
- 0
- 注册时间
- 2007-9-1
- 仿真币
-
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2010-10-6 22:50:05
|
显示全部楼层
来自 意大利
对此问题结贴,在一个师兄的帮助下,找到了更简单的方法,谢谢版主的帮助:(代码如下)
clear
x=1.8;y=2.6;z=-3.7;
fid1=fopen('fixture_layout_plate.py','r+');
fid2=fopen('fixture_layout_plate1.py','w+');
nline=0;
while ~feof(fid1)
tline = fgetl(fid1);
nline=nline+1;
if nline==164
[token{1}, tline] = strtok(tline,',');
[token{2}, tline] = strtok(tline,',');
[token{3}, tline] = strtok(tline,'(');
tline=sprintf('(%f,%f,%f))',x,y,z);
a=strcat(token{1},token{2},token{3},tline);
fprintf(fid2,'%s\n',a);
else
fprintf(fid2,'%s\n',tline);
end
end
fclose(fid1);
fclose(fid2); |
评分
-
1
查看全部评分
-
|