Escolar Documentos
Profissional Documentos
Cultura Documentos
year =
population =
>> year'
ans =
1984
1986
1988
1990
1992
1994
1996
>> population'
ans =
127
130
136
145
158
178
211
>> ytrans=year'
ytrans =
1984
1986
1988
1990
1992
1994
1996
>> ptrans=population'
ptrans =
127
130
136
145
158
178
211
>> %%array
>> year=1984:1990:1996
year =
1984
>> year=year=1984:2:1996
year=year=1984:2:1996
Error: The expression to the left of the equals sign is not a valid target for an assignment.
year =
>> min(min(population))
ans =
127
>>
>>
>>
population =
>> min(min(population))
ans =
127000000
>> max(max(population))
ans =
211000000
>> mean(mean(population))
ans =
155000000
>> sum(sum(population))
ans =
1.0850e+09
>> %%problem 2
A=
B=
C=
7 14 1
10 3 -2
8 -5 9
>> A+C
ans =
>> C-A
ans =
2.0000 12.0000 0
>> A*B
Error using *
>> B*A
ans =
>> 3.2*(A+C)
ans =
38.4000 51.2000 6.4000
>> 3.2*A+3.2*C
ans =
>> A*B
Error using *
>> A-B
>> A+B
>>
>> eye(size(A))
ans =
1 0 0
0 1 0
0 0 1
>> eye(size(A))+A
ans =
>> magic(2)+C
>> magic(3)*C
ans =
114 85 60
127 22 56
134 73 4
>> A
A=
C=
7 14 1
10 3 -2
8 -5 9
A=
>> A
A=
>> A*/C
A*/C
ans =
>> A.*C
ans =
35 28 1
10 21 6
48 50 6
>> A.^C
ans =
1.0e+06 *
>> 5^7
ans =
78125
>> magic(size(C))*C
ans =
114 85 60
127 22 56
134 73 4
>>