|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
请教一下各位前辈:关于全息谱程序的编写:编写三维全息谱程序!!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% three_dimension_holospectra_2006_RIDC_WFJ
% 输入:所有支承截面上的正弦项系数和余弦项系数形成的系数矩阵 r=[sxi cxi syi cyi]; i=1,2,…… n.
% 画出三维全息谱(椭圆、初相点0、创成线、方向标识点*)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [const]=holo3D(r)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
const=pi/180;
sizer=size(r);len=sizer(1);maxr=max(abs(r));z=fix(2.*max(maxr));
for i=1:len
t=1:361;
x(i,:)=r(i,1).*sin((t-1).*const)+r(i,2).*cos((t-1).*const);
y(i,:)=r(i,3).*sin((t-1).*const)+r(i,4).*cos((t-1).*const);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(1)
hold on
for i=1:len
plot(x(i,:)+z.*i,y(i,:)+z.*i,'LineWidth',[2]);
plot(x(i,1)+z.*i,y(i,1)+z.*i,'ro');
plot(x(i,37)+z.*i,y(i,37)+z.*i,'g*');
end
for t=1:36:361
for i=1:len
line_x(i)=x(i,t)+z.*i;
line_y(i)=y(i,t)+z.*i;
end
plot(line_x,line_y);
end
grid on;axis equal;set(gcf,'color',[1 1 1]);box on;title('三维全息谱图');
axis([0 (len+1).*z 0 (len+1).*z]);
hold off
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
return
|
|