Assign 1. Assign the value 9.81 to the variable gravity_si, and the value 32.17 to the variable gravity_eng. 2. Create a row vector containing the elements 0.5772, 1.618, 2.718 and 3.1416. Assign it to the variable math_consts. 3. Create a row vector containing the values from 50 to a value less than or equal to 1 with a decrement of 2. Assign it to the variable r_vec1. 4. Create a row vector containing linearly spaced values from 0 to π with exactly 37 elements. Assign it to the variable r_vec2. 5. Create a column vector containing the elements 6.022×1023, 1.381×10–23 and 6.626×10–34. Assign it to the variable science_consts. 6. Create a matrix containing the elements 10, 4, 7, 9 and 11 on the first column, the elements 12, 8, 2, 3 and 4 on the second column, and the elements 7, 0, 12, 6 and 5 on the third column. Assign it to the variable mat1. 7. Create a 6×8 matrix with all elements equal to zero. Assign it to the variable mat2. 8. Assign the word discrete as a character type to the variable chr1. 9. Assign the word mathematics as a string type to the variable str1. 10. Create a 2×2 string array containing the following terms: Generation and Transmission on the first row, and Distribution and Supply on the second row. Assign it to the variable str2.
Assign
1. Assign the value 9.81 to the variable gravity_si, and the value 32.17 to the variable gravity_eng.
2. Create a row vector containing the elements 0.5772, 1.618, 2.718 and 3.1416. Assign it to the variable math_consts.
3. Create a row vector containing the values from 50 to a value less than or equal to 1 with a decrement of 2. Assign it to the variable r_vec1.
4. Create a row vector containing linearly spaced values from 0 to π with exactly 37 elements. Assign it to the variable r_vec2.
5. Create a column vector containing the elements 6.022×1023, 1.381×10–23 and 6.626×10–34. Assign it to the variable science_consts.
6. Create a matrix containing the elements 10, 4, 7, 9 and 11 on the first column, the elements 12, 8, 2, 3 and 4 on the second column, and the elements 7, 0, 12, 6 and 5 on the third column. Assign it to the variable mat1.
7. Create a 6×8 matrix with all elements equal to zero. Assign it to the variable mat2.
8. Assign the word discrete as a character type to the variable chr1.
9. Assign the word mathematics as a string type to the variable str1.
10. Create a 2×2 string array containing the following terms: Generation and Transmission on the first row, and Distribution and Supply on the second row. Assign it to the variable str2.
Access
1. Load the data from workshop1.mat. It contains the following variables: sclr, r_vec, c_vec, mat, chr and str.
2. Extract the seventh element of r_vec. Assign it to the variable r_vec_e7.
3. Extract elements 11 to 18 of c_vec. Assign it to the variable c_vec_1118.
4. Extract elements 72, 96, 144, 240 and 432 of mat. Assign it to the variable mat_212.
5. Extract the entire twelfth row of mat. Assign it to the variable mat_r12.
6. Extract the corner elements of mat. Assign it to the variable mat_cor.
Modify
1. Replace the elements of r_vec with the indices 4, 6, 8, 10 and 15 with 3, 6, 9, 12 and 15, respectively.
2. Replace the elements of mat with the indices (4, 5), (4, 17), (20, 5) and (20,17) with 5, 8, 2 and 9, respectively.
3. Replace the all the elements of the eleventh column of mat with ones.
4. Replace the characters 11 to 19 of chr with the words white cat.
5. Replace the first entry of str with the value of sclr.
Step by step
Solved in 4 steps with 2 images
Can you please do the 2nd question above (Access)?