Question: a ) Create a 6 6 matrix in the middle two rows, and the middle two columns are 3 ' s and the rest areYou

a) Create a 66 matrix in the middle two rows, and the middle two columns are 3's and the rest areYou have to submit the matlab file in the form of:
YourName_StudentID_QuestionNumber; example:
Amer_20241423_Q1.
The commands should be submitted in the form of
m. file (type the commands for each question and save
it seperately)
a) Amer went to the market. He bought 5kg of carrots (4JDkg),2kg of apples ),6 lettuces
(2 for 4JD) and 6 Pepsi (2JD each). What is the total amount?
b) Write the MATLAB command for the following line:
Y=|xeax-cos(bx)|, for a=11,b= and x={2,4,6,8}
a) Create a 66 matrix in the middle two rows, and the middle two columns are 3's and the rest are
4's.
b) Write a MATLAB script file to plot the following on the same figure and on separate one (use all
what you learned to express the label, title, color, ... etc.) commands for drawing plot:
f=3t2+2t-0.5
g=2tcos(t)
where t varies from zero to ten with 0.5step. The function f should be in blue 0 and g in red *.
a) Create a row vector start between -10 and 10 with step 0.5.
b) Create a row vector start between -4 and 7 containing exactly 55 values and store the result in
vector x.
Write a MATLAB command(s) to do the following:
A=[0-1186;291310;-1543;91134]
a. Extract out the 3rd row of matrix A as a vector and assign this to vector m.
b. Transpose matrix A and store the result in matrix B.
c. Replace the 3rd column of matrix A with 2nd row of matrix B.
d. Delete the 3rd column of matrix B.
e. Create a 2**3 matrix D consisting of all elements in the first two rows ans the last three
columns of matrix A.
f. Find the maximum values in each column of matrix A.
g. Find the minimum values in each row of matrix A.
h. Sort each row of matrix A in ascending order and store the result in y.
i. Evaluate the sum of the 3rd column of matrix y.
4's.
b) Write a MATLAB script file to plot the following on the same figure and on separate one (use all
what you learned to express the label, title, color,
etc.) commands for drawing plot:
f=3t2+2t-0.5
g=2tcos(t)
where t varies from zero to ten with 0.5step. The function f should be in blue 0 and g in red *.
a) Create a row vector start between -10 and 10 with step 0.5.
b) Create a row vector start between -4 and 7 containing exactly 55 values and store the result in
vector x.
Write a MATLAB command(s) to do the following:
A=[0-1186;291310;-1543;91134]
a. Extract out the 3rd row of matrix A as a vector and assign this to vector m.
b. Transpose matrix A and store the result in matrix B.
c. Replace the 3rd column of matrix A with 2nd row of matrix B.
d. Delete the 3rd column of matrix B.
e. Create a 2*3 matrix D consisting of all elements in the first two rows ans the last three
columns of matrix A.
f. Find the maximum values in each column of matrix A.
g. Find the minimum values in each row of matrix A.
h. Sort each row of matrix A in ascending order and store the result in y.
i. Evaluate the sum of the 3rd column of matrix y.
a ) Create a 6 6 matrix in the middle two rows,

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 Programming Questions!