Академический Документы
Профессиональный Документы
Культура Документы
>> x = 10
x=
10
>> y = 23
y=
23
>> z = 99
z=
99
>>
Alguns Comandos
Exemplo2)
Exemplo 3)
>> clear
>> C=15
C=
15
>> D=2^10
D=
1024
>> E=4e-9
E=
4.0000e-009
>> F=pi
F=
3.1416
>> A = 5+2*i
A=
5.0000 + 2.0000i
>> B=3+4*j
B=
3.0000 + 4.0000i
Matrizes
>> A = [3 5 6 7]
A=
3 5 6 7
>> B = [2,4,5,0]
B=
2 4 5 0
>> C=[10;34;56;10]
C=
10
34
56
10
>> D=[1 2 3; 3 4 5; 6 7 8]
D=
1 2 3
3 4 5
6 7 8
Alguns Comandos para Matrizes
>> A=[3 5 6 7]
A=
3 5 6 7
>> A(2)
ans =
>> A(1:3)
ans =
3 5 6
A=
1 4
Exemplo 6
>> D = [1 2 3; 3 4 5; 6 7 8]
D=
1 2 3
3 4 5
6 7 8
>> D(1,2)=8
D=
1 8 3
3 4 5
6 7 8
>> D(:,1)
ans =
6
>> D(1,:)
ans =
1 8 3
>> transp(D)
ans =
1 3 6
8 4 7
3 5 8
>> det(D)
ans =
36
>> eye(3)
ans =
1 0 0
0 1 0
0 0 1
LINSPACE
>> linspace(1,10,10)
ans =
1 2 3 4 5 6 7 8 9 10
>> 1:1:10
ans =
1 2 3 4 5 6 7 8 9 10
>> Z=[1 2 3]
Z=
1 2 3
>> F=[4 5 6]
F=
4 5 6
>> G=[4;5;6]
G=
>> F*Z
Error using *
>> F*G
ans =
77
>> Z
Z=
1 2 3
>> F
F=
4 5 6
>> Z.*F
ans =
4 10 18
Polinômios
>> p=[2 1 1]
p=
2 1 1
>> x=1:2
x=
1 2
>> y=polyval(p,x)
y=
4 11
>> g=[0 1 1]
g=
0 1 1
>> s=p+g
s=
2 2 2
>> m=conv(p,g)
m=
0 2 3 2 1
Raízes
>> p=[2 1 1]
p=
2 1 1
>> r=roots(p)
r=
-0.2500 + 0.6614i
-0.2500 - 0.6614i
Símbolos
>> syms x
>> y=x^2+1
y=
x^2 + 1
>> diff(y)
ans =
2*x
>> int(y)
ans =
(x*(x^2 + 3))/3
>> simplify(ans)
ans =
(x*(x^2 + 3))/3
>> expand(ans)
ans =
x^3/3 + x
>> h=(x+1)^2
h=
(x + 1)^2
>> expand(h)
ans =
x^2 + 2*x + 1
>> simplify(h)
ans =
(x + 1)^2
Resolução de sistemas
A=
4 -2 2
-2 10 -7
2 -7 30
>> B=[8;11;-31]
B=
11
-31
>> inv(A)*B
ans =
3
1
-1
a11=4
a12=-2
a13=2
a14=8
a21=-2
a22=10
a23=-7
a24=11
a31=2
a32=-7
a33=30
a34=-31
Gráficos
x=-2:0.01:2;
plot(x,x.^2)
y=linspace(-8,8,50)
g=sin(y);
plot(y,g)
t=linspace(0,2*pi,100)
s1=sin(y);
s2=sin(y+2*pi/3);
s3=sin(y-2*pi/3);
plot(y,s1,y,s2,y,s3)
SIMULINK
Formas de Onda
10
Constant Scope
Step Scope2
Pulse Scope3
Generator
Ramp Scope4
Repeating Scope6
Sequence
Scope1
1
s
Sine Wave Integrator
PWM
1 Sine Wave2
<= Divide
Constant
Relational Scope1 2
Operator
Constant1
Repeating Scope2
Sequence
Sine Wave2
<= Divide Scope8
Relational Scope1 2
Operator
Constant1
g Scope2
+
v
-
Voltage Measurement
AC Voltage Source
Discre te ,
Ts = 2e -006 s.
powe rgui
Sistema Trifásico
Sine Wave
Sine Wave2
Encontrar o fluxo
Vs=(R1+R2+R3).Is
Ø =Is.L
Com:
R1 = 10 ohms
R2 = 15 ohms
R3 = 20 ohms
Vs= 2000V
L=1H
Vs
Constant3
R1
Divide
Constant Divide1 Scope
R2
Constant1
R3
Constant2
Add
Constant4
Sine Wave
Scope1
Step1 Add Scope
Sine Wave1
Add1
Va=240
TL=20
Ra=2.581
La=0.028
Laf=0.9483
If=240/281.3
J=0.02215
B=0.002953
Continuous
powe rgui <Speed wm (rad/s)>
20 TL m
Constant
A+ dc A- <Armature current ia (A)>
F+ F- <Electrical torque Te (n m)>
DC Machine
DC Voltage Source
Scope1
DC Voltage Source1
Va
Constant1
1
Laf*If
La.s+Ra
Add
Gain
Transfer Fcn
1
J.s+B
Add1 Transfer Fcn1
TL
Constant2
Gain1
Laf*If
Buck Boost
Continuous
powe rgui
Diode
Pulse
Generator g m m
a
1 2 k
Ideal Switch
+
DC Voltage Source
v
- Scope1
i
+ -
Scope2 Voltage Measurement
C urrent Measurement1
L= 0.00106656
C = 0.0000138875
R = 24 ohms
D = 33%