Question

%% Simple Matlab Exercise: A = ([ 1 0 0 1 ]); B = ([ 0...

%% Simple Matlab Exercise:

A = ([ 1 0 0 1 ]);

B = ([ 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 ]);

C = ([ 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 ]);

% A is hidden within B and C as multiples of its bits with long pauses (many zeros) at the % beginning and end of the vectors

% Develop a matlab program by which A can be recovered from B or C

Homework Answers

Answer #1

Ans)

There are many ways you can get 'A' from B or C,as there is no proper logic given how vector 'B' and 'C' is formed from vector 'A', I am writing simple matlab code for the above question because we know both inputs and outputs

%============MATLAB Code============%

B=([0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0]);

C=([0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0]);

A=[B(7) B(9) B(11) B(13)] % this line recovers vector A from B

A=[C(9) C(12) C(15) C(18)] % this line recovers vector A from C

========================

Output when you run the above code

=========

>>

A =

   1   0   0   1
A =

   1   0   0   1
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
MATLAB Create a matrix E, using A and B vectors as row 1 and row 2...
MATLAB Create a matrix E, using A and B vectors as row 1 and row 2 respectively A = 10 thru 1 B = 1 thru 4.2 with ten equally spaced elements and Find the indices (row and col) within E where (prob02a, b, c, d) E = 5 E > 4 E < 1.9 E > 1 and E < 2
Problem 3 you can use Matlab and also i give u the Problem 1 code its...
Problem 3 you can use Matlab and also i give u the Problem 1 code its on Matlab Using the same initial code fragment as in Problem 1, add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the impulse response of an IIR bandpass filter with band edge frequencies 750 Hz and 850 Hz and based on a 4th order Butterworth prototype. Name your program p3.sce this is the Problem 1 code and the solutin clear; clc;...
let us create a variable for a row vector a = [1, 4, 1, 3, 2,...
let us create a variable for a row vector a = [1, 4, 1, 3, 2, 5, 0] and calculate the mean value of its elements using the Matlab function ‘mean’ and store this value in variable aMean. Fig. 1 gives the Matlab code to do this. a = [1, 4, 1, 3, 2, 5, 0]; aMean = mean(a); Figure 1: Matlab code – row vector and mean of its elements. Let us now construct a row vector b that...
MATLAB 2017b Write a program which will: Accept three numbers from the user: a, b and...
MATLAB 2017b Write a program which will: Accept three numbers from the user: a, b and c which can assume any value. Accept Dx and Dy for the calculations of the function Write a function which accept a, b, c, Dx and Dy and will draw the following surface Where x and y vary in the range of -10?x?10 -10?y?10. Allow the user to rerun the program and exit the program upon request.
using Matlab 1) use the if/else structure to solve these problems (a,b) a) write a programme...
using Matlab 1) use the if/else structure to solve these problems (a,b) a) write a programme that reads an integer from the user. then your program should display a message whether the integer is even or add. b) many solid-fuel rocket motors consist of three stages. Once the first stages burns out, it separates from the missile and the second stage lights. then the second stages burns out and separate and the third stage light.Finally, once the third stages burns...
Exercise 6. Consider the following vectors in R3 . v1 = (1, −1, 0) v2 =...
Exercise 6. Consider the following vectors in R3 . v1 = (1, −1, 0) v2 = (3, 2, −1) v3 = (3, 5, −2 )   (a) Verify that the general vector u = (x, y, z) can be written as a linear combination of v1, v2, and v3. (Hint : The coefficients will be expressed as functions of the entries x, y and z of u.) Note : This shows that Span{v1, v2, v3} = R3 . (b) Can R3 be...
CHAPTER 2 MATLAB EXERCISES QUESTION 1: Enter the matrices A=[0 -4 5] and B= [-5 6...
CHAPTER 2 MATLAB EXERCISES QUESTION 1: Enter the matrices A=[0 -4 5] and B= [-5 6 7] 3 1 -2 0  -1 2 2 1 4 4 0 -3 USE MATLAB to find a) A + B b) B - 3A c) AB d) BA QUESTION 6: ENTER THE THREE MATRICES A= [1 2 3 4] B= [4 -6 3 5] 2 3 4 5 0 -3 -6 8 3 4 5 6   3 5 0 7 4 5 6 7...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5 3.4 2] a). Plot a scatter plot of the data b). Determine the coefficients of the polynomial ?0 + ?1? + ?2?2 which best fits the data c). Plot this function on the same plot as in part ‘a’. USE MATLAB CODE ONLY! USE MATLAB CODE ONLY! THANK YOU
Problem 1....... you can use Matlab The following Scilab code generates a 10-second “chirp” with discrete...
Problem 1....... you can use Matlab The following Scilab code generates a 10-second “chirp” with discrete frequencies ranging from 0 to 0.2 with a sampling frequency of 8 kHz. clear; Fs = 8000; Nbits = 16; tMax = 10; N = Fs*tMax+1; f = linspace(0.0,0.2,N); x = zeros(f); phi = 0; for n=0:N-1 x(n+1) = 0.8*sin(phi); phi = phi+2*%pi*f(n+1); end sound(x,Fs,Nbits); sleep(10000); //allows full sound to play Add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the...
Write a MATLAB function and test bench script code to solve the above simple RL/RC circuits...
Write a MATLAB function and test bench script code to solve the above simple RL/RC circuits by following the instructions noted below. The input signal and impulse response generation should be done in the function. The test bench script should be used only to call the function and for signal plotting purposes. No plotting should be done inside the function itself. Name your function L2_C Instructions: Input voltage ,x(t), can be AC or DC. Consider a variable ‘w1’ which can...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT