⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 controller1.m

📁 这个Matlab程序包
💻 M
字号:
function b=controller1(varargin)
fprintf('Welcome From Worldhitter')
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    fprintf('Provide The Following Data')
    Vs=input('\nEnter The Value Secondary Voltage Voltage(Volts) :')
    a=input('Enter The Value Of Delay Angle(Degrees):')
    R=input('Enter The Value Of Resistance :')
    fprintf('Wait For 2 Seconds')
    pause(2)
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    o=menu('Click On What You want' ,' Dc Voltage(Vdc)','','Dc Current(Idc)','','Root Mean Square(Load Or Output) Voltage(Vo)','','Root Mean Square(Load Or Output)Current(Io)','','Load Power(Po)','','Input Volt Ampere Rating(VA)','','Power Factor(PF)');
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
    if(o == 1)
     fprintf('\nThe Magnitude Of Dc Voltage Is As Under')
     c=a*3.14/180;  
     b=cos(c)-1;
     Vdc=sqrt(2)*Vs*b/6.28
     graphics1; %Function call for the graphics
     repeat; %Functin call for the repitition
     repeat(1); %Function call for repeating the main menu
     
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 3)
     fprintf('The Value Of Average Current Is As Under :')
     c=a*3.14/180;  
     b=cos(c)-1;
     Vdc=sqrt(2)*Vs*b/6.28;
     Idc=Vdc/R
     graphics1(1);
     repeat; %Functin call for the repitition
     repeat(1); %Function call for repeating the main menu
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 5)
     fprintf('Rms Output Voltage is as under :')
     c=a*3.14/180;  
     b=-c+sin(2*c)/2;
     Vo=Vs*sqrt(1/6.28*(6.28+b))
     graphics1(1,2);
     repeat;
     repeat(1);
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 7)
     fprintf('The Rms Output Current Is As Under :')
     c=a*3.14/180;  
     b=-c+sin(2*c)/2;
     Vo=Vs*sqrt(1/6.28*(6.28+b));
     Io=Vo/R
     graphics1(1,2,3);
     repeat;
     repeat(1);
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   elseif(o == 9)
     fprintf('The Load Power Is As Under :')
     c=a*3.14/180; 
     b=-c+sin(2*c)/2;
     Vo=Vs*sqrt(1/6.28*(6.28+b));
     Io=Vo/R;
     Po=Vo*Io
     graphics1(1,2,3,4);
     repeat;
     repeat(1)
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 11)
     fprintf('The Input Volt Ampere Rating Is As Under :')
     c=a*3.14/180; 
     b=-c+sin(2*c)/2;
     Vo=Vs*sqrt(1/6.28*(6.28+b));
     Io=Vo/R;
     Is=Io;
     VA=Vs*Is
     graphics1(1,2,3,4,5)
     repeat
     repeat(1)
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  elseif(o == 13)
     fprintf('The Value Of power Factor Is As Under :')
     c=a*3.14/180; 
     b=-c+sin(2*c)/2;
     Vo=Vs*sqrt(1/6.28*(6.28+b));
     Io=Vo/R;
     Is=Io;
     VA=Vs*Is    
     
     c=a*3.14/180; 
     b=-c+sin(2*c)/2;
     Vo=Vs*sqrt(1/6.28*(6.28+b));
     Io=Vo/R;
     Po=Vo*Io
     
     PF=Po/VA
     graphics1(1,2,3,4,5,6)
     repeat
     repeat(1)
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  end
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -