Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

Solve the equation. Check your answers. x + 2 = x - 4

Answered: 1 week ago

Question

=+d) What components would you now say are in this series?

Answered: 1 week ago