Question: 1. Scalar Variables: Make the following variables a. a = 10; b. b = 2.5 1023 c. c = 2+3i, where i is the square
1. Scalar Variables: Make the following variables
a. a = 10;
b. b = 2.5 1023
c. c = 2+3i, where i is the square root of -1
d. d = e j2/3 , where j is the square root of -1 and e is Eulers number (use exp, pi)
2. Vector Variables: Make the following variables
a. aVec = [3.14 15 9 26]
b. bVec = [ 2.71
8
28
182]
c. cVec = [5 4.8 -4.8 -5] (all the numbers from 5 to -5 in increments of -0.2)
d. dVec = [100 100.01 100.99 101 ] (Logarithmically spaced numbers between 1 and 10, use logspace, make sure you get the length right)
3. Matrix Variables: Make the following variables
a. Create a 9 x 9 matrix full of 2s (use ones command)
aMat = [ 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2]
b. Create a 9 x 9 matrix full of 3s (using zeros command)
c. Create a 9 x 9 matrix of all zeros but with the values [1 2 3 4 5 6 7 8 9] on the main diagonal (use zeros, diag)
cMat = [ 1
2
3
4
5
6
7
8
9 ]
d. Create a 10 x 10 matrix where the vector 1:100 runs down the columns (use reshape)
dMat = [ 1 91
2 92
10 100]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
