MATLAB Please complete number 2 & 3 Programming with MATLAB-Quiz 2 1. Create the
ID: 3597851 • Letter: M
Question
MATLAB
Please complete number 2 & 3
Explanation / Answer
1)))v=[-1,9,3,3.5,10,-18;];
v(6)=[]
w=[6
2.5
-0.7
10
14]
y=(w/v)
2))))))
u=[-17,-10,1,3,7]
p=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
r=u*p
l=p'*w
output:
3)))))))
k=[15,5,-5,-15,-25,-35,-45]
idx=(k<0)&(k>-100)
for i = 1:7;
if (idx(i)==1)
k= k(idx)
end
end
output:
k=[-5,-15,-25,-35,-45]
4))))))))))
e=[-1 4 -6;
5 2 5;
12 -9 -1;
10 11 -14];
e(3,2)=9;
e
output:
e=[-1 4 -6;
5 2 5;
12 9 -1;
10 11 -14];
6))))))
e=[-1 4 -6;5 2 5; 12 -9 -1; 10 11 -14]
f=sortrows(e)
r=reshape(f,2,6)
output:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.