Write a MATLAB program to accomplish the following: Create two vectors, a and b, where vector a contains all positive integers less than 100 that are evenly divisible by 10, and b contains all positive, even integers greater than 0 and less than or equal to 18. Divide the values in vector a, element by element, by the values in vector b, and assign the result to vector c. Square all the elements of vector c and then subtract 19 from every squared element of c. Assign the result to vector d. ONLY display the values of c, and d in the Command Window.

Respuesta :

Answer:

Explanation:

Below is the complete MATLAB code that performs the given operations.

a = 10:10:99 % Generating first vector

b = 2:2:18  % Generating 2nd vector

c = rdivide(a,b) % Dividing vector a by b and storing in c

d = times(c,c) -19 % Subtracting 19 from each element of vector c

c % Displaying value of c

d % Displaying value of d

Output screenshot

C =

 5 5 5 5 5 5 5 5 5

d =

6 6 6 6 6 6 6 6 6

ACCESS MORE