LISTA
REVISÃO
–
MATLAB
FAÇA
AS
QUESTÕES
SEM
UTILIZAR
Dê a resposta para cada um dos itens abaixo:
1. >> a=8.6+6.8
16. >> q=length(p)
a = 15.4000
q=3
2. >> b=8/5
17. >> r=size(p)
b = 1.6000
r=31
3. >> c=3+2i
18. >> s=[3 2 -5;4 7 9]
c = 3.0000 + 2.0000i
s = 3 2 -5
4 7 9
4. >> d=5-7j
d = 5.0000 - 7.0000i
19. >> s(1,2)=8
5. >> e=[5 1.5, -0.3]
s = 3 8 -5
47 9
e = 5.0000 1.5000 -0.3000
20. >> s(3,6)=1
6. >> f=10:5:40
f = 10 15 20 25 30 35 40
s = 3 8 -5 0 0 0
47 9000
00 0001
7. >> g=5:9
21. >> t=s([1 3],2)
g=56789
8. >> h=linspace(10,40,7)
t=8
0
h = 10 15 20 25 30 35 40
22. >> u=s(1:2,[1 3])
9. >> i=h(2)
u = 3 -5
4 9
i = 15
10. >> j=h(3:5)
j = 20 25 30
11. >> l=h(5:-2:1)
l = 30 20 10
23. >> s(:,3)=[]
s=38000
47000
00001
24. >> s(1,:)=[]
12. >> m=h([4 1])
s=47000
00001
m = 25 10
25. >> x=magic(4)
13. >> n=[1.5;3.2;-8.9]
x = 16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
n = 1.5000
3.2000
-8.9000
14. >> o=n'
o = 1.5000 3.2000 -8.9000
15. >> p=(1:3)'
p=1
2
3
26. >> y=sum(x)
y = 34 34 34 34
27. >> w=prod(x)
w = 2880 2156 2700 1248
28. >> z=mean(x)
O
MATLAB!!!
z = 8.5000 8.5000 8.5000 8.5000
39. >> J=rand(3,5)
29. >> A=min(min(x))
A=1
J = 0.9649 0.9572 0.1419 0.7922 0.0357
0.1576 0.4854 0.4218 0.9595 0.8491
0.9706 0.8003 0.9157 0.6557 0.9340
30. >> B=sort(x)
40. >> K='MATLAB',L='SOFTWARE PROGRAMAÇÃO'
B=4 2 3 1
5 7 6 8
9 11 10 12
16 14 15 13
K =MATLAB
L =SOFTWARE PROGRAMAÇÃO
31. >> x
M =LAB
x = 16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
42. >> N=[K ' excelente ' L]
32. >> C=diag(x)
43. >> O=1:5,P=10:10:50,Q=2
C = 16
11
6
1
O= 1 2 3 4 5
P = 10 20 30 40 50
Q= 2
33. >> D=diag(C)
D = 16 0 0 0
0 11 0 0
0 0 60
0 0 01
41. >> M=K(4:6)
N =MATLAB excelente SOFTWARE DE
PROGRAMAÇÃO
44.>> R=O+Q
R=34567
45.>> S=O./P
S = 0.1000 0.1000 0.1000 0.1000 0.1000
46.>> T=Q.^O
34. >> E=tril(x)
T = 2 4 8 16 32
E = 16 0 0 0
5 11 0 0
9 7 6 0
4 14 15 1
35.>> F=triu(x)
47. >> U=1:10,V=9:-1:0,X=5
U = 1 2 3 4 5 6 7 8 9 10
V=987654321 0
X=5
F = 16 2 3 13
0 11 10 8
0 0 6 12
0 0 0 1
48. >> Y=U>=V
36.>> G=zeros(2)
W=0001111100
G=00
00
50. >> Z=~W
37.>> H=ones(2,3)
H=111
111
38. >> I=rand(3)
I = 0.8147 0.9134 0.2785
0.9058 0.6324 0.5469
0.1270 0.0975 0.9575
Y=0000111111
49. >> W=(U>3)&(U<=8)
Z=1110000011
Download

LISTA REVISÃO – MATLAB FAÇA AS Dê a resposta