Académique Documents
Professionnel Documents
Culture Documents
clear all
a=5
a =
a =
b=10
b =
10
s=a+b
s =
15
R=a-b
R =
-5
D=a/b
D =
0.5000
M=a*b
M =
50
d=a^2
d =
25
M/2
ans =
25
c=5^2-6/2+5*4
c =
42
x=sqrt(2)
x =
1.4142
p=pi
p =
3.1416
nthroot(-8^,3)
nthroot(-8^,3)
|
{Error: Expression or statement is incorrect--possibly unbalanced (,
{, or [.
}
nthroot(-8,3)ans
nthroot(-8,3)ans
|
{Error: Unexpected MATLAB expression.
}
nthroot(-8,3)
ans =
-2
log10(100)
ans =
log(10)
ans =
2.3026
Z=rem(50,4)
Z =
2
whos
Name Size Bytes Class Attributes
D 1x1 8 double
M 1x1 8 double
R 1x1 8 double
Z 1x1 8 double
a 1x1 8 double
ans 1x1 8 double
b 1x1 8 double
c 1x1 8 double
d 1x1 8 double
p 1x1 8 double
s 1x1 8 double
x 1x1 8 double
who
D M R Z a ans b c d p s x
whos z
z
{Undefined function or variable 'z'.
}
z
{Undefined function or variable 'z'.
}
Z
Z =
whos z
z
{Undefined function or variable 'z'.
}
Z
Z =
CLEAR Z
{Undefined function 'CLEAR' for input arguments of type 'char'.
}
clear Z
Z
{Undefined function or variable 'Z'.
}
clear all
whos
clc
dir
help sqrt
<strong>sqrt</strong> Square root.
<strong>sqrt</strong>(X) is the square root of the elements of X.
Complex
results are produced if X is not positive.
Overloaded methods:
<a href="matlab:help codistributed/sqrt">codistributed/sqrt</a>
doc sqrt
pwd
ans =
path
CREANDO VECTORES
{Undefined function 'CREANDO' for input arguments of type 'char'.
}
V=[2 5 8 6 -10]
V =
2 5 8 6 -10
V=`2,5,8,6,-10]
V=`2,5,8,6,-10]
|
{Error: The input character is not valid in MATLAB statements or
expressions.
}
V=[2,5,8,6,-10]
V =
2 5 8 6 -10
V=[2;5;8;6:-10]
V =
2
5
8
V=[2;5;8;6;-10]
V =
2
5
8
6
-10
whos
Name Size Bytes Class Attributes
V 5x1 40 double
ans 1x19 38 char
a=1:4
a =
1 2 3 4
b:0:3:9
{Undefined function or variable 'b'.
}
b=o:3:9
{Undefined function or variable 'o'.
}
b=0:3:9
b =
0 3 6 9
z=(0:0.1:0.5)*pi
z =
y=cos(z)
y =
ans =
y(2)
ans =
0.9511
y([5 1 6])
ans =
d=[a(1:2:4)5 8 9]
d=[a(1:2:4)5 8 9]
|
{Error: Unexpected MATLAB expression.
}
d=[a(1:2:4)589]
d=[a(1:2:4)589]
|
{Error: Unexpected MATLAB expression.
}
d=[a(1:2:4) 5 8 9]
d =
1 3 5 8 9
d-3
ans =
-2 0 2 5 6
a+b
ans =
1 5 9 13
length(a)
ans =
4
dot(a,b)
ans =
60
a*b
{Error using <a href="matlab:helpUtils.errorDocCallback('mtimes')"
style="font-weight:bold"> * </a>
Inner matrix dimensions must agree.
}
a
a =
1 2 3 4
b =
0 3 6 9
a.*b
ans =
0 6 18 36
a.^2
ans =
1 4 9 16
a./b
ans =
b.^a
ans =
0 9 216 6561
b(3)=[]
b =
0 3 9
b
b =
0 3 9
b(5)012
b(5)012
|
{Error: Unexpected MATLAB expression.
}
b(5)=12
b =
0 3 9 0 12
b'
ans =
0
3
9
0
12
GRAFICAR1
X =
GRAFICAR1
X =
X =
X =
X =
y1 =
GRAFICAR1
x =
y1 =
GRAFICAR1
x =
y1 =
Empty matrix: 1-by-0
GRAFICAR1
ans =
y1 =
y2 =
y =
-0.4000
GRAFICAR1
ans =
y1 =
y2 =
y =
-0.4000
GRAFICAR1
ans =
y1 =
1
y2 =
y =
-0.4000
GRAFICAR1
{Error: <a href="matlab: opentoline('C:\Users\matematica\Desktop\CLASE
1 MBCEUPSMAT 2016 0\GRAFICAR1.m',2,3)">File: GRAFICAR1.m Line: 2
Column: 3</a>
Expression or statement is incomplete or incorrect.
}
GRAFICAR1
ans =
y1 =
y2 =
y =
-0.4000
GRAFICAR1
ans =
y1 =
y2 =
1
y =
-0.4000
GRAFICAR1
ans =
y1 =
y2 =
y =
-0.4000
GRAFICAR1
y1 =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
Columns 28 through 31
y2 =
Columns 1 through 9
1.0000 1.1105 1.2446 1.4065 1.6017 1.8371 2.1213
2.4647 2.8807
Columns 10 through 18
Columns 19 through 27
Columns 28 through 31
y =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
Columns 28 through 31
GRAFICAR1
y1 =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
7.8400 8.4100 9.0000 9.6100 10.2400 10.8900 11.5600
12.2500 12.9600
Columns 28 through 31
y2 =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
Columns 28 through 31
y =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
Columns 28 through 31
GRAFICAR1
y =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
Columns 28 through 31
clc
M=[1 2 3 4;5 6 7 8]
M =
1 2 3 4
5 6 7 8
M =
1 2 3 4
5 6 7 8
A =
3 5 8
5 1 9
7 4 9
A'
ans =
3 5 7
5 1 4
8 9 9
trace(A)
ans =
13
det(A)
ans =
113.0000
A(3,3)=0
A =
3 5 8
5 1 9
7 4 0
**
**
|
{Error: Unexpected MATLAB operator.
}
A
A =
3 5 8
5 1 9
7 4 0
A(:,1)
ans =
3
5
7
A(3,:)
ans =
7 4 0
B=A(3:-1:1,:)
B =
7 4 0
5 1 9
3 5 8
Warning: Image is too big to fit on screen; displaying at 50%}
{> In <a href="matlab: opentoline('C:\Program Files
(x86)\MATLAB\R2012a\toolbox\images\imuitools\private\initSize.m',72,1)
">imuitools\private\initSize at 72</a>
In <a href="matlab: opentoline('C:\Program Files
(x86)\MATLAB\R2012a\toolbox\images\imuitools\imshow.m',259,1)">imshow
at 259</a>
In <a href="matlab: opentoline('C:\Users\matematica\Desktop\CLASE 1
MBCEUPSMAT 2016 0\procesamientoimagen.m',13,1)">procesamientoimagen at
13</a>}
T=`[7 0 12]
T=`[7 0 12]
|
{Error: The input character is not valid in MATLAB statements or
expressions.
}
T=[7 0 12]
T =
7 0 12
A(2,:)=T
{Subscripted assignment dimension mismatch.
}
A(2,:)=T
{Subscripted assignment dimension mismatch.
}
A=[3 5 8;5 1 9;7 4 9]
A =
3 5 8
5 1 9
7 4 9
A(2,:)=T
A =
3 5 8
7 0 12
7 4 9
S:size(A)
{Undefined function or variable 'S'.
}
s=size(A)
s =
3 3
A(2,6)=1
A =
3 5 8 0 0 0
7 0 12 0 0 1
7 4 9 0 0 0
S=size(A)
S =
3 6
[f c]=size(A)
f =
c =
ones(3,2)
ans =
1 1
1 1
1 1
ones(3)
ans =
1 1 1
1 1 1
1 1 1
zeros(2)
ans =
0 0
0 0
zeros(2,3)
ans =
0 0 0
0 0 0
eye(3)
ans =
1 0 0
0 1 0
0 0 1
eye(5,4
eye(5,4
|
{Error: Expression or statement is incorrect--possibly unbalanced (,
{, or [.
}
eye(5,4)
ans =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 0 0
A =
2 3 -4
1 -1 1
4 -7 14
b=[3;-0.5;2]
b =
3.0000
-0.5000
2.0000
x=A/b
{Error using <a href="matlab:helpUtils.errorDocCallback('mrdivide')"
style="font-weight:bold"> / </a>
Matrix dimensions must agree.
}
clc
clear all
f=x^2-12
{Undefined function or variable 'x'.
}
syms x
f=x^2-12
f =
x^2 - 12
x=solve(f)
x =
2*3^(1/2)
-2*3^(1/2)
whos ans
whos ans
double ans
ans =
97 110 115
whos ans
Name Size Bytes Class Attributes
double ans
ans =
97 110 115
whos x
Name Size Bytes Class Attributes
x 2x1 60 sym
double(ans)
ans =
97 110 115
doublex)
doublex)
|
{Error: Unbalanced or unexpected parenthesis or bracket.
}
double(x)
ans =
3.4641
-3.4641
t=ans(2)
t =
-3.4641
close all
diary off