📄 rotwavesb.m
字号:
% space vectors in balanced three-phase systems
warning off
c=eval(get(hcy,'string'));
p=get(hsl,'value');m=round(1/p);
theta=0;a=2*pi/3;
%avialt=avifile('rot0.avi','compression','cinepak');
% figure('units','normalized','Position',[.1 .05 .6 .6],'Name','SPACE VECTORS',...
% 'NumberTitle','off','ToolBar','none');
%set(gcf,'color','w')
axes('units','normalized','Position',[.10 .07 .8 .65])
for k=1:m
plot([0 0],[0 0],'color','w'),grid,hold on
set(gca,'Xlim',[-2 2],'Ylim',[-2 2],'visible','off')
rotarrow(1.5*[cos(theta) sin(theta)],'k')
rotarrow([cos(theta+a)*cos(a) -cos(theta+a)*sin(a)],'b');
rotarrow([cos(theta-a)*cos(a) cos(theta-a)*sin(a)],'g');
rotarrow([cos(theta) 0],'r')
h=findobj(gca,'Type','line');
set(h,'LineWidth',2)
legend(h,'Phase A','Phase B','Phase C','Resultant R')
axis equal
set(gca,'Xlim',[-2.0 2.0],'Ylim',[-2.0 2.0],'visible','on')
%f=getframe(gca)
% avialt=addframe(avialt,f);
hold off
theta=theta+2*pi/m;
M(k)=getframe;
end
%avialt=close(avialt);
uicontrol('Units','normalized', ...
'Style','PushButton',...
'BackgroundColor',[.5 .5 .5], ...
'Callback','movie(M,c)', ...
'FontSize',10, ...
'FontWeight','bold', ...
'ForegroundColor',[1 1 1], ...
'Position',[0.87 0.14 0.09 .06], ...
'String','Play', ...
'TooltipString','Play');
uicontrol('Units','normalized', ...
'Style','PushButton',...
'BackgroundColor',[.5 .5 .5], ...
'Callback','pause', ...
'FontSize',10, ...
'FontWeight','bold', ...
'ForegroundColor',[1 1 1], ...
'Position',[0.87 0.08 0.09 .06], ...
'String','Pause', ...
'TooltipString','Pause');
%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -