Question: I'm supposed to create a program in matlab that is supposed to do the following listed below, I will also have my code that I
I'm supposed to create a program in matlab that is supposed to do the following listed below, I will also have my code that I typed up below. My code doesn't work and I was wondering if you could help me fix it to do the following and explain where I messed up.
(a) Prompt the user to enter their name. (b) Prompt the user to enter an evenly spaced 1 X 3 vector between 2 and 9. (c) Prompt the user to enter another evenly spaced 1 X 3 vector starting from 5 to 1 decreased by 2. (d) Calculate the element by element multiplication and division of the two vectors. (e) Calculate the matrix multiplication of the two vectors.
clc clear user_name=input('what is your name?','s'); a=input('enter the number between 2 and 9:'); b=input('enter the number between 2 and 9:'); V=linspace(a,b,3); disp(V); q=input('enter the number 5:'); r=input('enter the number 1:'); s=input('enter 3:'); T=linspace(q,r,s); disp(T); R=V'.*T; disp(R); (f) Use the fprintf command to display the size of the output vector as well as the results to the user in a reasonable report format.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
