t=1:5;
s1=sin(t);
s2=cos(t);
s=[t;s1;s2];
fid1=fopen(\'test.dat\',\'wt\');
fprintf(fid1,\'\nThis is a Formated file\n\');
fprintf(fid1,\'\n%4d   %+12.5E  %+12.5E\n\',s);
fclose(fid1);
fid2=fopen(\'test.dat\',\'rt\');
[A1,count1]=fscanf(fid2,\'%s\',5);
[A2,count2]=fscanf(fid2,\'%4d  %e  %e\',[3,inf]);
A2=A2\';
fclose(fid2);

  

fid=fopen(\'d:\data.txt\',\'r\')
line=fgetl(fid)
k=findstr(line,\'cgg\')
s=length(k)
line=fgetl(fid)
k=findstr(line,\'cgg\')
s=length(k)
fclose(fid)
-------
for k=0:99
p=int2str(k);
fname=strcat(\'picture\',p,\'.bmp\') %构成一有规律的文件名
打开图像fname
进行处理;
关闭当前图像文件;
end

  

 

版权声明:本文为caiyishuai原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/caiyishuai/p/11157733.html