?? acdc.m
字號:
%This function offers solution to the formulaes of single phase ac switch and general
%dc switch
%This function runs independently as well as with "power_electronics"
%In order to execute this function type ''acdc'' on command prompt
function a=acdc(varargin)
fprintf('Welcome From Worldhitter')
i=menu('Choose Type Of The Switch','Single Phase Ac Switch','Dc Switch','To Do Once Again')
if (i == 1)
%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
fprintf('\nProvide The Following Data : ')
Im=input('\nEnter The Peak Current(Amperes) :')
fprintf('Wait For 2 Seconds :')
h=menu('Choose What You Want To Be Calculated','Is','Ia','Ir');
if( h == 1 )
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fprintf('\nWelcome From Worldhitter')
fprintf('\n The value Of Rms Line Current is :')
Is=Im/sqrt(2)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thanks %Function call
thanks1(1,1) %Reapeat
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
elseif(h == 2)
fprintf('\nWelcome From Worldhitter')
fprintf('\n The value Of Average Current is :')
Ia=Im/pi
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thanks(1) %Function call
thanks1(1,1) %Reapeat
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
elseif(h == 3)
fprintf('\nWelcome From Worldhitter')
fprintf('\n The value Of Rms Current is :')
Ir=Im/2
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thanks(1,1) %Function call
thanks1(1,1)%Repeat
end
%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
elseif(i == 2)
fprintf('\nProvide The Following Data : ')
Vs=input('\nEnter The Supply Voltage(Volts) :')
L=input('\nEnter The Inductance(Henry) :')
C=input('\nEnter The Value Of Capacitance(Farads) :')
wt=input('\nEnter The Angle(Degrees) :')
e=menu('Choose What You Want To Be Calculated','Charging Current(it)','Capacitor Voltage(vc)');
fprintf('\n Wait For 2 Seconds')
pause(2)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if(e == 1)
fprintf('\nThe Value Of Charging Current is as under')
a=sin(wt);
it=Vs*sqrt(C/L)*a
thanks1 %Function call
thanks1(1,1)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
elseif(e == 2)
fprintf('\nThe Value Of Capacitor Voltage is as under')
b=1-cos(wt);
Vc=Vs*b
thanks1(1) %Function call
pause(1)
thanks1(1,1)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -