📄 rl_load.m
字号:
function f=rl_load(varargin)
%This programme solves various formulaes for diode connected to rl load
%This function also offers graph for the function selected
%This function runs independently as well as with "power_electronics"
%In order to execute this function type ''rl_load'' on command prompt
fprintf('Welcome From Worldhitter')
h=menu('Choose What You Want To Be Calculated','i(t)','di(t)/d(t)','di(t)/d(t) at t=0','Vl(t)');
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
%________________________________________________________________________
if( h == 1 )
fprintf('\nProvide The Following Data : ')
Vs=input('\nEnter The Source Voltage(Volts) :')
t=input('Enter The Time(Seconds) :')
R=input('Enter The Resistance(Ohms) :')
L=input('Enter The Inductance(Henry) :')
fprintf('Wait For 2 Seconds :')
pause(2)
y=(1-exp(-t*R/L))
it=Vs*y/R
fprintf('Now We will Proceed Towards The Graphical Representation')
pause(1)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Data=1:64;Data=(Data'*Data)/64;
CreateStruct.WindowStyle='replace';
CreateStruct.Interpreter='tex';
h=msgbox('i(t)=Vs/R(1-exp(-t/RL))','Graph Equation','custom',Data,winter(64),CreateStruct);
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
t1=linspace(pi/10,2*pi);
y=(1-exp(-t1*R/L));
it=Vs*y/R;
l=menu('Choose The Line Style','-','--',':','.','-.')
type=['-','--',':','.','_.'];
plot(t1,it,type(l))
m=menu('Choose A Data Marker','+','o','*','x','.','s','d','^','v','>','<','p','h');
type=['+','o','*','x','.','s','d','^','v','>','<','p','h'];
plot(t1,it,type(m) )
hold on
c=menu('Choose The Line Color','r','g','b','c','m','y','k','w','Strange')
type=['r','g','b','c','m','Vc','k','w','Strange'];
plot(t1,it,type(c))
hold off
pause(1)
if (c == 9)
plot(t1,it,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',12)
end
xlabel('Time')
ylabel('i(t)')
pause(1)
closereq
msgbox('Thanx For Using My Programme ','','custom',Data,cool(64))
pause(1)
closereq
thanks4 %Function call
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
elseif (h == 2)
fprintf('\nProvide The Following Data : ')
Vs=input('\nEnter The Source Voltage(Volts) :')
t=input('Enter The Time(Seconds) :')
R=input('Enter The Resistance(Ohms) :')
L=input('Enter The Inductance(Henry) :')
fprintf('Wait For 2 Seconds :')
pause(2)
y=(exp(-t*R/L))
ditbydt=Vs*y/L
fprintf('Now We will Proceed Towards The Graphical Representation')
pause(1)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Data=1:64;Data=(Data'*Data)/64;
CreateStruct.WindowStyle='replace';
CreateStruct.Interpreter='tex';
h=msgbox('di(t)/d(t)=Vs/L(exp(-t/RL))','Graph Equation','custom',Data,jet(64),CreateStruct);
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
t1=linspace(pi/10,2*pi);
y=(exp(-t1*R/L));
dt=Vs*y/R;
l=menu('Choose The Line Style','-','--',':','.','-.')
type=['-','--',':','.','_.'];
plot(t1,dt,type(l))
m=menu('Choose A Data Marker','+','o','*','x','.','s','d','^','v','>','<','p','h');
type=['+','o','*','x','.','s','d','^','v','>','<','p','h'];
plot(t1,ditbydt,type(m) )
hold on
c=menu('Choose The Line Color','r','g','b','c','m','y','k','w','Strange')
type=['r','g','b','c','m','Vc','k','w','Strange'];
plot(t1,ditbydt,type(c))
hold off
pause(1)
if (c == 9)
plot(t1,ditbydt,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',12)
end
xlabel('Time')
ylabel('di(t)/d(t)')
pause(1)
closereq
Data=1:64;Data=(Data'*Data)/64;
msgbox('Thanx For Using My Programme ','','custom',Data,cool(64))
pause(1)
closereq
thanks4 %Function call
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
elseif (h == 3)
fprintf('\nProvide The Following Data : ')
Vs=input('\nEnter The Source Voltage(Volts) :')
L=input('Enter The Inductance(Henry) :')
fprintf('Wait For 2 Seconds :')
pause(2)
it=Vs/L
fprintf('This Is The Value Of Current At t=0')
fprintf('\nNow We will Proceed Towards The Graphical Representation')
pause(1)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Data=1:64;Data=(Data'*Data)/64;
CreateStruct.WindowStyle='replace';
CreateStruct.Interpreter='tex';
h=msgbox('di(t)/d(t)(at t=0)=Vs/L','Graph Equation','custom',Data,colorcube(64),CreateStruct);
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
t1=linspace(pi/10,2*pi);
it=Vs/L;
l=menu('Choose The Line Style','-','--',':','.','-.')
type=['-','--',':','.','_.'];
plot(t1,it,type(l))
m=menu('Choose A Data Marker','+','o','*','x','.','s','d','^','v','>','<','p','h');
type=['+','o','*','x','.','s','d','^','v','>','<','p','h'];
plot(t1,it,type(m) )
hold on
c=menu('Choose The Line Color','r','g','b','c','m','y','k','w','Strange')
type=['r','g','b','c','m','Vc','k','w','Strange'];
plot(t1,it,type(c))
hold off
pause(1)
if (c == 9)
plot(t1,it,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',12)
end
xlabel('Time')
ylabel('di(t)/d(t) at t=0')
pause(1)
closereq
msgbox('Thanx For Using My Programme ','','custom',Data,cool(64))
pause(1)
closereq
thanks4 %Function call
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
elseif(h == 4)
fprintf('\nProvide The Following Data : ')
Vs=input('\nEnter The Source Voltage(Volts) :')
t=input('Enter The Time(Seconds) :')
R=input('Enter The Resistance(Ohms) :')
L=input('Enter The Inductance(Henry) :')
fprintf('Wait For 2 Seconds :')
pause(2)
y=(exp(-t*R/L))
Vl=Vs*y
fprintf('\nNow We will Proceed Towards The Graphical Representation')
pause(1)
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Data=1:64;Data=(Data'*Data)/64;
CreateStruct.WindowStyle='replace';
CreateStruct.Interpreter='tex';
h=msgbox('Vl=Vs*exp(-t*R/L)','Graph Equation','custom',Data,flag(64),CreateStruct);
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
t1=linspace(pi/10,2*pi);
y=(exp(-t1*R/L));
Vl=Vs*y;
l=menu('Choose The Line Style','-','--',':','.','-.')
type=['-','--',':','.','_.'];
plot(t1,Vl,type(l))
m=menu('Choose A Data Marker','+','o','*','x','.','s','d','^','v','>','<','p','h');
type=['+','o','*','x','.','s','d','^','v','>','<','p','h'];
plot(t1,Vl,type(m) )
hold on
c=menu('Choose The Line Color','r','g','b','c','m','y','k','w','Strange')
type=['r','g','b','c','m','Vc','k','w','Strange'];
plot(t1,Vl,type(c))
hold off
pause(1)
if (c == 9)
plot(t1,Vl,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',12)
end
xlabel('Time')
ylabel('Vl')
pause(1)
closereq
msgbox('Thanx For Using My Programme ','','custom',Data,cool(64))
pause(1)
closereq
thanks4 %Function call
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -