(Solved): please i need only part 4 1) The circuit shown below is an xor gate implemented with four NAND gates ...
please i need only part 4
1) The circuit shown below is an xor gate implemented with four NAND gates. Write a MATLAB myxor function that uses only not() and and() functions to calculate the element-by-element xor of two arrays. 2) Write a MATLAB function called Ctype() that decides whether a capacitor is larger than or equal to 1μF. If so, the function prints out " C is probably electrolytic". Otherwise, the function prints out " C is probably non-polarized". An example of how the function would be used is shown below. > Ctype(2e-6) C is probably electrolytic 3) Write a MATLAB Script file to ask the user to choose the color at which he wants to plot sin(x) from −2π to 2π [ use color red, yellow, green, use switch Matlab control statement ] 4) Plot f(x)=⎩⎨⎧01−0.5x+20x<00≤x≤22<x≤4x>4⎭⎬⎫ from [−5,5] use matlab if control
if expression, statements, end evaluates an expression, and executes a group of statements when the expression is true.Given function is: where the value range is: Type the following code in MATLAB to plot :x=-5:0.01:5; % Initiating the x vectorN = length(x); % Count the number of points in x