Professional Documents
Culture Documents
2 0 4;
-1 - 31];
Error using vertcat
Dimensions of matrices being concatenated are not
consistent.
>> A=[1 - 1 3;
2 0 4;
-1 - 3 1];
Error using vertcat
Dimensions of matrices being concatenated are not
consistent.
>> A=[1 -1 3;
2 0 4;
-1 -3 1];
>> B=[1 2 3 4; -1 0 2 -3; -3 1 -6 2];
>> C=[ 1 2 3;4 5 6;7 8 9];
>> A*B
ans =
-7
5 -17
-10
8 -18
-1
-1 -15
13
16
7
>> C^3+A
ans =
469
575
687
1064
1305
1552
1655
2031
2413
>> (A'*B)'
ans =
-4
-5
13
15
-4 -10
11
2
B=
-1
-3
-3
-6
-1
>> [V,v]=eig(B)
V=
Columns 1 through 2
Columns 3 through 4
v=
Columns 1 through 2
Columns 3 through 4
V=
Columns 1 through 2
Columns 3 through 4
v=
Columns 1 through 2
Columns 3 through 4
>> det(A)
ans =
>> det(C)
ans =
6.6613e-16
ans =
6.6613e-16
ans =
6.661338147750939e-16
>> format
>> help format
format LONG
format LONGE
digits.
format LONGG
format HEX
format +
Hexadecimal format.
The symbols +, - and blank are printed
Example:
format short, pi, single(pi)
displays both double and single pi with 5 digits as 3.1416 while
format long, pi, single(pi)
displays pi as 3.141592653589793 and single(pi) as 3.1415927.
ans =
6.6613e-16
>> det(A)
ans =
>> det(C)
ans =
6.6613e-16
>>
>> rec(A)
Undefined function 'rec' for input arguments of type 'double'.
>> orth(A)
ans =
-0.59106
0.088255
-0.77532
-0.3364
-0.22255
0.93757
>> null(A)
ans =
-0.8165
0.40825
0.40825
>> orth(B)
ans =
-0.45162
-0.26885
0.79949
-0.29082
0.054838
0.49652
0.46404
0.73153
0.43017
-0.78836
0.13066
0.41996
-0.77973
-0.2443
-0.35834
0.45158
>> null(B)
ans =
>> orth(C)
ans =
-0.21484
0.88723
-0.52059
0.24964
-0.82634
-0.38794
>> null(C)
ans =
-0.40825
0.8165
-0.40825
>> t=0:0.1:4*pi;
>> y=sin(t);
>> plot(x,y) grid on
hold on
plot(x,y) grid on
|
Error: Unexpected MATLAB expression.
>> t=0:0.1:4*pi;
>> y=sin(t);
>> plot(t,y) grid on
hold on
plot(t,y) grid on
|
Error: Unexpected MATLAB expression.
>> plot(t,y)
grid on hold on
Error using grid
Too many input arguments.
>> t=0:0.1:4*pi;
>> y=sin(t);
>> plot(t,y)
grid on
hold on
>>
>>
>>
>> t=-2*pi:0.1:2*pi;
y=cos(t);
plot(t,y)
grid on
hold on
>> t=-2*pi:0.1:2*pi;
y=cos(t);
plot(t,y)
grid on
hold on
>>
>>
>>
>> x=-5:0.02:5;
>> y=x^2-3*x-2;
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
>> y=x.^2-3*x-2;
>> plot(x,y)
>> plot(x,y)
>> x=-5:0.02:5;
>> y=x.^2-3*x-2;
>> z=x.^3-2*x+1;
>> figure(2)
>> subplot(2,1,1)
plot(x,y,'g-')
grid on
hold on
subplot(2,1,1)
plot(x,y,'b--')
grid on
hold on
>> x=-5:0.02:5;
y=x.^2-3*x-2;
z=x.^3-2*x+1;
figure(2)
subplot(2,1,1)
plot(x,y,'g-')
grid on
hold on
subplot(2,1,2)
plot(x,y,'b--')
grid on
hold on
>>
>>
>>
>>
>> G1=tf(1,[200 0 0])
G1 =
------200 s^2
G2 =
s+1
----------s^3 + 4 s^2
>> series(G1,G2)
ans =
s+1
----------------200 s^5 + 800 s^4
>> G=feedback(ans,1)
G=
s+1
------------------------200 s^5 + 800 s^4 + s + 1
>> polos(G)
Undefined function 'polos' for input arguments of type 'tf'.
>> polos(tf(G))
Undefined function 'polos' for input arguments of type 'tf'.
>> pole(G)
ans =
-3.9999 +
0i
0.13325 +
0.13928i
0.13325 -0.13327 +
-0.13327 -
>> zero(G)
ans =
-1
>> step(G)
0.13928i
0.12602i
0.12602i
grid on