Question: Use Matlab 2.4 (20 points) Write a script to solve the following problems using only vector operations: First, ask a user to enter two vectors

Use Matlab

Use Matlab 2.4 (20 points) Write a script to solve the following

2.4 (20 points) Write a script to solve the following problems using only vector operations: First, ask a user to enter two vectors by keyboard named A and B of equal length. Then, create a vector C that combines A and B such that C = [A(1)-B(1) A(1)*B(1) A(2)-B(2) A(2)*B(2) A(end)-B(end) A(end)*B(end)]. For example, if A = [2, 4, 8] and B = [1, 3, 9], C should contain [1, 2, 1, 12, -1, 72] Save this into a script file named hw0204.m. Show the MATLAB code and the testing above example result. Also test on A = [7, 9, 13] and B = [4, 5, 16], and show the result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!