Matlab Clase
-
Upload
cenicienta -
Category
Documents
-
view
219 -
download
3
description
Transcript of Matlab Clase
>> R=5;A=pi*R^2
A =
78.5398
>> R=5;A=pi*R^2;
>> radio=[3 4 5 7]
radio =
3 4 5 7
>> radio1=[3;4;5;7]
radio1 =
3
4
5
7
>> radio(2)
ans =
4
>> A= [1 5 3;4 2 6;3 8 7]
A =
1 5 3
4 2 6
3 8 7
>> A(2,3)
ans =
6
>> length(radio)
ans =
4
>> size(A)
ans =
3 3
>> m=size(A)
m =
3 3
>> m(1)
ans =
3
>> m(2)
ans =
3
>> radio=[3 4 5],Area=pi*radio,^2
radio=[3 4 5],Area=pi*radio,^2
|
Error: Unexpected MATLAB operator.
>> radio=[3 4 5],Area=pi*radio.^2
radio =
3 4 5
Area =
28.2743 50.2655 78.5398
>> radio
radio =
3 4 5
>> radio.^2
ans =
9 16 25
>> A*A
ans =
30 39 54
30 72 66
56 87 106
>> A^2
ans =
30 39 54
30 72 66
56 87 106
>> A.^2
ans =
1 25 9
16 4 36
9 64 49
>> A
A =
1 5 3
4 2 6
3 8 7
>>
>> A= [1 5 3;4 2 6;3 8 7]
A =
1 5 3
4 2 6
3 8 7
>> R=5;A=pi*R^2
A =
78.5398
>> size(A)
ans =
1 1
>> sum(radio)
ans =
12
>> A= [1 5 3;4 2 6;3 8 7]
A =
1 5 3
4 2 6
3 8 7
>> sum(A)
ans =
8 15 16
>> sum(sum(A))
ans =
39
>> rem(15,4)
ans =
3
>> rem(10,4)
ans =
2
>> 8~=9
ans =
1
>> 7==8
ans =
0
>> 5<9
ans =
1
>> 9>7>5
ans =
0
>> 9>7 & 7>5
ans =
1
>> 9>7 | 7>5
ans =
1
>> 9>7 | 7>50
ans =
1
>> C=[1 4;5 3]
C =
1 4
5 3
>> inv(C)
ans =
-0.1765 0.2353
0.2941 -0.0588
>> Det(C)
Undefined function 'Det' for input arguments of type 'double'.
Did you mean:
>> det(C)
ans =
-17
>> C'
ans =
1 5
4 3
>> eig(C)
ans =
-2.5826
6.5826
>> for h=1:5
disp(h)
end
1
2
3
4
5
>> for h=1:3:10
disp([h,h^2])
end
1 1
4 16
7 49
10 100
>> for h=1:3:10
>> for h=1:3:9
disp([h,h^2])
end
1 1
4 16
7 49
>> fplot('3*x^2+6*x-2',[-3,3])
>> glid on
Undefined function 'glid' for input arguments of type 'char'.
>> grid on
>> fplot('3*x^2+6*x-2',[-3,3])
>> grid on
>>
>>
>> balboa=inline('x^2-5')
balboa =
Inline function:
balboa(x) = x^2-5
>> balboa(5)
ans =
20
>> peluche=inline
peluche =
Inline function (empty)
>> peluche=inline('3*x+2*y')
peluche =
Inline function:
peluche(x,y) = 3*x+2*y
>> peluche(5,6)
ans =
27
>> syms x
>> f1='2*x^3-5*x'
f1 =
2*x^3-5*x
>> diff(f1,x)
ans =
6*x^2 - 5
>> diff(f1,x,2)
ans =
12*x
>> m=diff(f1,x)
m =
6*x^2 - 5
>> x=3,eval(m)
x =
3
ans =
49
>>