📄 dmop3.m
字号:
function [f]=DMOP2(FileNamePrefix,time)
%获得AVI的名字
d1= datevec(now);
movFile= strcat(FileNamePrefix,num2str(d1(1),'%04d'));
movFile= strcat(movFile,num2str(d1(2),'%02d'));
movFile= strcat(movFile,num2str(d1(3),'%02d'));
movFile= strcat(movFile,num2str(d1(4),'%02d'));
movFile= strcat(movFile,num2str(d1(5),'%02d'));
% movFile= strcat(movFile,num2str(d1(6),'%02d'));
movFile= strcat(movFile,'.avi');
mov = avifile(movFile);
% 将结果的点集 显示出来
for timecount=1:time
clear s;
fn= num2str(timecount,'%04d.txt');
FileName = strcat(FileNamePrefix, fn);
fid = fopen(FileName,'rt');
if fid ==-1
return ;
end;
s = fscanf(fid,'%g %g',[3 inf]);
fclose(fid);
s=s';
s= sortrows(s,[1 2]);
% k=1;
% for i=1:length(s)
% flag =0;
% for j=1:length(s)
% if ((i~=j) &&(s(i,1) >=s(j,1) ) && (s(i,2) >=s(j,2)) )
% flag =1;
% break;
% end;
% end;
% if (flag==1)
% continue;
% end;
% f(k,1) = s(i,1);
% f(k,2) = s(i,2);
% k=k+1;
% end;
for i=1:length(s)
for (j=1:length(s))
if ( (i~=j) && (s(i,1) <=s(j,1) ) && (s(i,2) <=s(j,2)) && (s(i,3) <=s(j,3)))
s(j,1) =10000;
end;
end;
end;
clear x1;
clear y1;
k=1;
for i=1:length(s)
if (s(i,1) < 999)
x1(k)= s(i,1);
y1(k)= s(i,2);
z1(k)= s(i,3);
k=k+1;
end;
end;
% 开始画点
h= plot(x1,y1,z1, '--rs','LineWidth',1,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',2,'Marker','s');
for rr = 1:30
set(h,'XData',x1,'YData',y1, 'ZData',z1)
M(rr) = getframe(gca);
mov = addframe(mov,M(rr));
end;
end;
mov= close(mov);
movie(M,1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -