Question: atlab Function Help: Currently I Have Written This Code For Performing The Task Found At The Bottom: The Top Commented Portion Of The Code Will

atlab Function Help: Currently I Have Written This Code For Performing The Task Found At The Bottom: The Top Commented Portion Of The Code Will Create A Halfwave Rectifier While The Rest Allows For A Call To Access Either A Full Wave Or Half Wave Rectifier. I Am Having Trouble Calling The Function Properly Using Main(Wfm, N, F0, Vrms). I Need To Pass The

Matlab function help:

Currently I have written this code for performing the task found at the bottom:

The top commented portion of the code will create a halfwave rectifier while the rest allows for a call to access either a full wave or half wave rectifier. I am having trouble calling the function properly usingmain(wfm, N, f0, Vrms).I need to pass the function through a fourier series and plot the function as well. Please help and explain!

%Half-wave Rectifier

%{

l=linspace(0,10,100);

sig=sin(2*pi*50*l);

subplot(211)

plot(sig); grid

% u=1:9;

% t=(1:)

for t=1:100

if sin(2*pi*50*l(t))

sig(t)=0;

else

sig(t) = sin(2*pi*50*l(t));

end

end

subplot(212)

plot(sig); grid

%}

clc

clear

flag = input('Select "1" for halfwave or "2" for fullwave=');

T = input('Time period of input signal (in seconds)=');

To = T/2;

A = input('Peak value of input signal=');

n = ceil(To/0.0001);

N = n * 0.0001;

w = zeros(2*n,1);

k = [-N:1:N];

if flag == 1

for i = 1:2*n

if i >= n;

%w(i) = (2*pi/To)*i*0.0001;

%wt = w;

%disp('Halfwave Vectors');

%disp(wt);

l=linspace(0,10,100);

sig=sin(2*pi*50*l);

subplot(211)

plot(sig); grid

% u=1:9;

% t=(1:)

for t=1:100

if sin(2*pi*50*l(t))

sig(t)=0;

else

sig(t) = sin(2*pi*50*l(t));

end

end

subplot(212)

plot(sig); grid

end

end

end

if flag == 2

%for i = 1:2*n

%if i >= n;

%w(i) = (2*pi/To)*i*0.0001;

%wt = w;

%disp('Fullwave Vectors');

%disp(wt);

%end

%end

end

Task to be completed instructions:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!