1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ser-zykov [4K]
3 years ago
14

Write a MATLAB function named 'expansion' that calculates and plots for any arbitrary signal . The expansion function should cre

ate a longer vector by adding an additional element between neighboring elements in the original vector. Each new element be should equal to the average of its neighboring elements. Only use matrix/vector manipulations; do NOT use loops.

Computers and Technology
1 answer:
Dennis_Churaev [7]3 years ago
4 0

Answer:

Check the explanation

Explanation:

function expansion = expansion(n)

%create a vector to store additional elements between neighboring elements

average_neighbor = 0.5 * (n(1:end-1) + n(2:end));

%creating the longer array "expansion" of zeros

%which has double the length of "average_neighbor"

%and original vector "n" combine.

lenA = length(average_neighbor)*2;

lenN = length(n)*2;

expansion = zeros(1,(lenA+lenN));

%place original vector n and average_neighbor in every second element after the starting point

expansion(1:2:lenN) = n;

expansion(2:2:lenA) = average_neighbor;

%removes 0 in the array

expansion(expansion == 0) = [];

stem(expansion)

end

%Please see the screen shot given below for more clarity

You might be interested in
Which type of packet is sent by a dhcp server after receiving a dhcp discover message?
emmasim [6.3K]
A<span> DHCPOffer packet is sent to the client.</span>
5 0
3 years ago
If Count = 1 and X = 3, what will be displayed when code corresponding to the following pseudocode is run? Do Set Y = Count + X
kirill115 [55]

Answer:

4 5 6

Explanation:

Since there is a do-while loop, you need to check the values for each iteration until the condition (Count <= X) is not satisfied.

First iteration ->  Count = 1 and X = 3, Y = 1 + 3, Write Y -> 4

Second iteration ->  Count = 2 and X = 3, Y = 2 + 3, Write Y -> 5

Third iteration ->  Count = 3 and X = 3, Y = 3 + 3, Write Y -> 6

After the third iteration count is equal to 4 and X is equal to 3. That is why loop ends.

3 0
4 years ago
If you play video games, please answer these questions it’s for a survey for my game development class!!
Mademuasel [1]

Answer:

Cause it fun and i have fun

call of duty and football and boxing games

Since i was 7 now im 13

with your mind

I dont know

4 0
3 years ago
What is a bug?
Stels [109]

Answer:

a defect in a software program that prevents it from working correctly

Explanation:

got it right on edge2021

6 0
3 years ago
Answer this correct and get brainly
Leya [2.2K]

Pseudocode:

import random

fetch user input on a lucky number

insert input into variable - "response"

new variable, random = randint

condition to check wheather random is our response

display results

Python Code:

import random

def main():

response = int(input("Guess my lucky number, its between 1 and 100: "))

lucky_number = random.randint(1,100)

if response == lucky_number:

print(f"Wow you're right, it is {lucky_number}")

else:

print("Sorry, Try Again")

main()

Reminder:

intended for python3 as i included the format f

also it could be done without the import, just manually insert a number

i'll leave the post mortum to you

5 0
3 years ago
Read 2 more answers
Other questions:
  •  What should every Software Engineer know about Software Architecture? ”<br> ??
    12·1 answer
  • File formats are linked to certain programs.<br><br> True<br> False
    12·2 answers
  • Wireless networks are the most difficult type of network to set up <br> true or false
    15·1 answer
  • How do I attach a file on the computer?
    13·1 answer
  • In the SQL environment, a _____________ is a logical group of database objects – such as tables and indexes – that are related t
    11·1 answer
  • Gini is a manager at a website design firm. She has a timeline prepared for the product to be delivered to the client. She needs
    6·2 answers
  • A local variable that is declared as ____ causes the program to keep the variable and its latest value even when the function th
    10·1 answer
  • Write python code that does the following: Ask the user to enter as many as number they want; Then find the sum and the average
    10·1 answer
  • Given two input integers for an arrowhead and arrow body, print a right-facing arrow.
    15·1 answer
  • Explain how communication facilitate cordination​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!