The matrix A has values 1 2 3 4 5 4 3 2 8 7 6 5 10 10 9 8 Wh
The matrix A has values: [1, 2, 3, 4; 5, 4, 3, 2; 8, 7, 6, 5; 10, 10, 9, 8] What Matlab commands would you use to access the sub-matrix [7, 6; 10, 9]? Write some MATLAB code to calculate the harmonic series to a value of k. The harmonic series is defined as sigma^k = n = 1 1/n, If the letter \'a\' is encoded in ASCII as 97, what are the ASCII values used to represent \'hello? How would you recreate the vector produced by linspace(0, 25, 51) without using lenspiece? Briefly explain the difference between int8, uint8, int64, anduint64.
Solution
b) % define the first 4 terms
n = 1 : 4
seq = 1./n
% find the sum of these terms
sum(seq)
The answer is:
n = 1 2 3 4
seq = 1.0000 0.5000 0.3333 0.2500
ans = 2.0833
% define the first 100 terms
n = 1 : 100;
seq = 1./n;
% find the sume of thes terms
sum(seq)
The answer is:
ans = 5.1874
![The matrix A has values: [1, 2, 3, 4; 5, 4, 3, 2; 8, 7, 6, 5; 10, 10, 9, 8] What Matlab commands would you use to access the sub-matrix [7, 6; 10, 9]? Write so The matrix A has values: [1, 2, 3, 4; 5, 4, 3, 2; 8, 7, 6, 5; 10, 10, 9, 8] What Matlab commands would you use to access the sub-matrix [7, 6; 10, 9]? Write so](/WebImages/31/the-matrix-a-has-values-1-2-3-4-5-4-3-2-8-7-6-5-10-10-9-8-wh-1089417-1761573383-0.webp)