The matrix A has values: [1, 2, 3, 4; 5, 4, 3, 2; 8, 7, 6, 5; 10, 10, 9, 8] What
ID: 3939216 • Letter: T
Question
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.Explanation / Answer
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
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.