1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| clear all; close all; clc
F = [10 50:50:1700]; ff = length(F);
K = 0:10:360; l = length(K);
k = 0; v=1;
for ii = 1:l
X = 0;
Y = 0;
Z = 0;
az = K(ii); el = 20;
fig = figure(1);
set(fig,'Name',['Rotation de ' num2str(K(ii)) '°'],...
'NumberTitle','off','Color',[1 1 1],...
'Position',[200 200 600 600]);
set(gca,'FontSize',12,'LooseInset',get(gca,'TightInset'),...
'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
ax = axes('FontSize',12);
grid(ax,'off');
set(ax,'visible','off')
[x,y,z] = sphere(80);
hs3 = surf(x,y,z);
set(hs3,'EdgeColor','none','FaceColor',[0.8 0.8 0.8],'FaceLighting',...
'phong','AmbientStrength',0.5,'DiffuseStrength',0.7,...
'SpecularStrength',0.05,'SpecularExponent',50,...
'BackFaceLighting','reverselit');
camlight left; hidden on; alpha(.5); hold on
plot3(X,Y,Z,'or','LineStyle','none','MarkerEdgeColor','r',...
'MarkerFaceColor','r','MarkerSize',4)
t = -2*pi:0.01:2*pi; RADIUS = 1.0;
plot3(RADIUS*sin(t),RADIUS*cos(t),0*t,'Color',[1 1 1],'linewidth',1)
plot3(0*t,RADIUS*cos(t),RADIUS*sin(t),'Color',[1 1 1],'linewidth',1)
plot3(RADIUS*sin(t),0*t,RADIUS*cos(t),'Color',[1 1 1],'linewidth',1)
plot3([-1 1],[0 0],[0 0],'Color',[1 1 1],'linewidth',1)
plot3([0 0],[-1 1],[0 0],'Color',[1 1 1],'linewidth',1)
plot3([0 0],[0 0],[-1 1],'Color',[1 1 1],'linewidth',1)
xlabel('S_{1}'), ylabel('S_{2}'), zlabel('S_{3}')
xlim([-1 1]),ylim([-1 1]),zlim([-1 1])
view(ax,az,el);
grid(ax,'off');
axis (ax,'vis3d');
set(ax,'visible','off')
axt = axes('units','normalized');
text(.5,1,['P = ' num2str(F(v)) 'mW'],'fontsize',14,'parent',axt,'horizontalalignment','center')
grid(axt,'off');
set(axt,'visible','off')[/B]
saveas(fig,['rot_' num2str(K(ii)) '_deg'],'fig')
close(fig)
Name = ['rot_' num2str(K(ii)) '_deg.fig'];
open(Name),drawnow,pause(1)
k = k + 1;
G(k) = getframe(gcf);
close all
v = v+1;
end
movie2avi(G,'test_video.avi','compression','none','fps',5,'quality',100) |
Partager