Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your...

90.2K

Verified Solution

Question

Electrical Engineering

Write a MATLAB code to obtain the following. Keep yourcode commented whenever required. Copy your source code and commandwidow outcomes and screen shots of any plots in yoursolution.

Generate the following vectors and also implement the Table-1operations-map by employing the switchstatement and an appropriate loop.

  • Generate a vector ‘DEC1’ asfollow.

DEC1 =

5     1    3     0    2    5    0     2

  • Concatenate vector ‘DEC1’ eight timesin order to obtain a bigger row vector‘DEC’
  • N = The length of vector‘DEC’
  • Generate a vector ‘t’ with‘N’ equally spaced values within therange of 0 to1
  • x = round of26sin(2Ï€9t).
  • y = ‘x’multiply by 2.

Table-1

DEC(ind)

Operation

0

Res(ind)= x(ind) multiply by y(ind)

1

Res(ind)= x(ind) divided by y(ind)

2

Res(ind)= square root of [x(ind).y(ind)]

3

Res(ind)= x(ind) subtract from y(ind)

5

Res(ind)= x(ind) add to y(ind)

* In Table-1,ind is presenting the vector index.

Answer & Explanation Solved by verified expert
3.7 Ratings (665 Votes)
The Matlab Code is as follows DEC15 1 3 0 2 5 0 2 Generates the vector DEC1 with the given values DEC DEC1 DEC1 DEC1 DEC1 DEC1 DEC1 DEC1 DEC1 Concatenate the DEC1 8 times to obtain DEC N lengthDEC Finding length of vector DEC t 01N1 Generating vector t with N equally spaced values within the range of 0 to 1 x round26sin2pi9t round off the result of 26sin2pi9t yx2 y xmultiply by 2 For loop for defining Table1 ind values 0 1 2 3 4 5 for ind05    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students