Only have 18 minutes! Please answer question fast! PROBLEM #1 Assume that the va
ID: 2267608 • Letter: O
Question
Only have 18 minutes! Please answer question fast!
PROBLEM #1 Assume that the variables A and B, shown below, have already been generated in MATLAB 213 5 A 9 2 6 3 4 75 2 10 12 15 25 30 47 Write one single MATLAB statement that generates the variable C, shown below, using the existing variable A. 1. C7 -2 Write one single MATLAB statement that generates the variable D, shown below, using the existing variables A and B. 2. Page 1 of 2 2 1.3 -s 10 12 15 3. Consider the folilowing MATLAB statements: What is M equal to after the above two statements have been executed? PROBLEM write and evaluate the MATLAB statements that will calculate f and g given by the mathematical expressions show below, where t 1,2, 3, 4,5,6,7,8,9L w-2, -02and d 06 f(t)- gt)-0.5+d cos (wt) Report the contents of the f and g ablest w.c andExplanation / Answer
A=[2 -1 3 5; 0 0 1 7; 9 2 6 3; 4 -7 -5 -2; 1 0 3 6];
B=[10 12 15;25 30 47];
1) C=A([2 4 5],2:end) gives
C =
0 1 7
-7 -5 -2
0 3 6
2)
D=[A(:,1:3);B(1,:)] gives
D =
2 -1 3
0 0 1
9 2 6
4 -7 -5
1 0 3
10 12 15
3)
M=C;
M(2,[4,5])=9 will give M matrix as
M =
0 1 7 0 0
-7 -5 -2 9 9
0 3 6 0 0
Pb 2)
t=[1 2 3 4 5 6 7 8 9];
w=2;
c=.2;
d=.6;
for i=1:length(t)
f(i)=(1-exp(-c*t(i))*sin(w*t(i)))/(1+t(i)^2)
g(i)=0.5 + d*cos(w*t(i))^2;
end
Values of f are { 0.1278 0.3015 0.1153 0.0327 0.0462 0.0314 0.0151 0.0163 0.0137}
Values of g are { 0.6039 0.7563 1.0532 0.5127 0.9224 0.9273 0.5112 1.0503 0.7616}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.