MATLAB QUESTION *I would greatly appreciate it if you can give me the matlab cod
ID: 3592977 • Letter: M
Question
MATLAB QUESTION
*I would greatly appreciate it if you can give me the matlab codes. This is for my intro to linear algebra course. *
please only do c,d (i'll post another question for a,b thanks!)
7. (Use format short) We shall apply the ideas of the previous problem on the set of functions 1, cos2 t, sin2t. That is, we shall determine if there exist nontrivial scalars x1,x2,X3 such that x2 cos2 t + x3 sin2 t = 0 (for all t) (You may already be well-aware of such scalars that satisfy this equation. Pretend you don't know for now. We shall describe a method for discovering a linear relation among these functions.) (a) Use an approach similar to the previous problem. Plug in 0.0.1.0.2 to obtain three equations for the three unknowns. Let A be the coefficient matrix of the corresponding linear system Ax = 0 Note that any nontrivial solution x to (*) will be a nontrivial solution to Ax = 0, So if one exists we can find it by solving Ax = 0, Enter A into MATLAB and compute R-rref (A). (b) * Give a nontrivial solution x to Ax 0. Choose your solution x so that it has integer entries (c) For the solution x you discovered above, see if the equation *) holds (perhaps up to a tiny error from roundoff) for the "random" number t = 1.7392. This is mounting evidence that we have discovered an actual linear identity relating the three functions 1, cos2 t, and sin2t (d) * Quote a basic trig identity which explains why (*) holds for every t (for your x) (e) (Optional - for fun) Above, we "discovered" a well-known trig identity. Repeat the ideas of this problem on the set [sin(t), sin(3t), sin3(t) to discover a not-so-well-known trig identityExplanation / Answer
a)
% part a, defining coeficient matrix A
A = [
1 cos(0).^2 sin(0).^2;
1 cos(0.1).^2 sin(0.1).^2;
1 cos(0.2).^2 sin(0.2).^2
]
% computing rref of A
R = rref(A)
b) Non trivial solution
x = [1 ; -1; -1]
c) 1 + (-1*cos(1.7392).^2) + (-1*sin(1.7392).^2) is
which is very close to 0.
d) sin^2(t) + cos^2(t) = 1; so if we choose x2 and x3 as -1 and x1 as 1 then this solve the problem.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.