Answer to Question #243275 in MatLAB for Vamsi reddy

Question #243275
Matrix variables.make the following variables

a. aMat= V a 9x9 matrix full of 2's (use 'ones' or 'zeros').

12

1

b. bMat=1

2

01

a 9x9 matrix of all zeros, but with the values 1-9 on the main

to ... 9
diagonal (use 'zeros', 'diag').

CMat=1_{-5}^{11}
0
1
Expert's answer
2021-09-28T06:23:40-0400
clc

%aMat= V a 9x9 matrix full of 2's (use 'ones' or 'zeros').
aMat = randi([0,1], 9,9)

%9x9 matrix of all zeros, but with the values 1-9 on the main
v = [1:9];
bMat = diag(v)


OUTPUT







Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS