Question: Solve and show code using MATLAB 2.5 Write a script to solve the following problem using only vector operations. Assume you have two vectors named
2.5 Write a script to solve the following problem using only vector operations. Assume you have two vectors named Al and B of equal length and create a vector C1 that CI = [A1(l)+B1(1) Al(1)-B1(1) Al(2)-B1(2) A1(2)-B 1(2) . . . . Al(end)+BI(end) (a) Type Al = [2, 4, 8, 101 and BI = [3, 9, 27, 21]. Generate Cl to be [5,-1, 13,-5, 35,-19, 31, (b) Use the "input" function to allow a user to type any A1 and B1. Create the script file named combines Al and B1 such that Al(end)-B1(end)l bw2 m2" and run this seript fle Then, try the following esample Show the soript file and the input and output. Al = [-2-4-8-10,-12] and BI = [3, 9, 27, 21, 23]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
