t=linspace(-20,20);
ret=zeros(size(t));
ret(0 <= t & t < 1) = 1;
ret
ret =
Columns 1 through 6
0 0 0 0 0 0
Columns 7 through 12
0 0 0 0 0 0
Columns 13 through 18
0 0 0 0 0 0
Columns 19 through 24
0 0 0 0 0 0
Columns 25 through 30
0 0 0 0 0 0
Columns 31 through 36
0 0 0 0 0 0
Columns 37 through 42
0 0 0 0 0 0
Columns 43 through 48
0 0 0 0 0 0
Columns 49 through 54
0 0 1 1 0 0
Columns 55 through 60
0 0 0 0 0 0
Columns 61 through 66
0 0 0 0 0 0
Columns 67 through 72
0 0 0 0 0 0
Columns 73 through 78
0 0 0 0 0 0
Columns 79 through 84
0 0 0 0 0 0
Columns 85 through 90
0 0 0 0 0 0
Columns 91 through 96
0 0 0 0 0 0
Columns 97 through 100
0 0 0 0
S.type='trend'
S =
type: 'trend'
S.breaks=1
S =
type: 'trend'
breaks: 1
S.kmin=2
S =
type: 'trend'
breaks: 1
kmin: 2
S.amplitudes=[1,2,0,-1,0,0,-4]
S =
type: 'trend'
breaks: 1
kmin: 2
amplitudes: [1 2 0 -1 0 0 -4]
t
t =
Columns 1 through 3
-20.0000 -19.5960 -19.1919
Columns 4 through 6
-18.7879 -18.3838 -17.9798
Columns 7 through 9
-17.5758 -17.1717 -16.7677
Columns 10 through 12
-16.3636 -15.9596 -15.5556
Columns 13 through 15
-15.1515 -14.7475 -14.3434
Columns 16 through 18
-13.9394 -13.5354 -13.1313
Columns 19 through 21
-12.7273 -12.3232 -11.9192
Columns 22 through 24
-11.5152 -11.1111 -10.7071
Columns 25 through 27
-10.3030 -9.8990 -9.4949
Columns 28 through 30
-9.0909 -8.6869 -8.2828
Columns 31 through 33
-7.8788 -7.4747 -7.0707
Columns 34 through 36
-6.6667 -6.2626 -5.8586
Columns 37 through 39
-5.4545 -5.0505 -4.6465
Columns 40 through 42
-4.2424 -3.8384 -3.4343
Columns 43 through 45
-3.0303 -2.6263 -2.2222
Columns 46 through 48
-1.8182 -1.4141 -1.0101
Columns 49 through 51
-0.6061 -0.2020 0.2020
Columns 52 through 54
0.6061 1.0101 1.4141
Columns 55 through 57
1.8182 2.2222 2.6263
Columns 58 through 60
3.0303 3.4343 3.8384
Columns 61 through 63
4.2424 4.6465 5.0505
Columns 64 through 66
5.4545 5.8586 6.2626
Columns 67 through 69
6.6667 7.0707 7.4747
Columns 70 through 72
7.8788 8.2828 8.6869
Columns 73 through 75
9.0909 9.4949 9.8990
Columns 76 through 78
10.3030 10.7071 11.1111
Columns 79 through 81
11.5152 11.9192 12.3232
Columns 82 through 84
12.7273 13.1313 13.5354
Columns 85 through 87
13.9394 14.3434 14.7475
Columns 88 through 90
15.1515 15.5556 15.9596
Columns 91 through 93
16.3636 16.7677 17.1717
Columns 94 through 96
17.5758 17.9798 18.3838
Columns 97 through 99
18.7879 19.1919 19.5960
Column 100
20.0000
plot(t,haarplot(S,t))
[T,D]=haar(S)
T =
type: 'trend'
breaks: 2
kmin: 1
amplitudes: [1.5000 -0.5000 0 -2]
D =
type: 'detail'
breaks: 2
kmin: 1
amplitudes: [-0.5000 0.5000 0 -2]
plot(t,haarplot(S,t),t,haarplot(T,t))
plot(t,haarplot(S,t),t,haarplot(T,t),t,haarplot(D,t))
plot(t,haarplot(S,t),t,(haarplot(T,t)+haarplot(D,t)))
plot(t,haarplot(S,t),t,(haarplot(T,t)+haarplot(D,t)),'*')
T
T =
type: 'trend'
breaks: 2
kmin: 1
amplitudes: [1.5000 -0.5000 0 -2]
D
D =
type: 'detail'
breaks: 2
kmin: 1
amplitudes: [-0.5000 0.5000 0 -2]
dec.T=T
dec =
T: [1x1 struct]
dec.D=D
dec =
T: [1x1 struct]
D: [1x1 struct]
clear dec
dec.T=T
dec =
T: [1x1 struct]
dec.D{1}=D
dec =
T: [1x1 struct]
D: {[1x1 struct]}
cella{1}=rand(3)
cella =
[3x3 double]
cell{2}=rand(3
cell{2}=rand(3
|
{Error: Expression or statement is
incorrect--possibly unbalanced (, {,
or [.
}
cell{2}=rand(3)
cell =
[] [3x3 double]
cell{1}
ans =
[]
cella{1}=rand(3)
cella =
[3x3 double]
cella{2}=rand(3)
cella =
[3x3 double] [3x3 double]
cella{1}
ans =
0.7922 0.0357 0.6787
0.9595 0.8491 0.7577
0.6557 0.9340 0.7431
cella{2}
ans =
0.3922 0.7060 0.0462
0.6555 0.0318 0.0971
0.1712 0.2769 0.8235
cella{3}=1
cella =
Columns 1 through 2
[3x3 double] [3x3 double]
Column 3
[1]
dec
dec =
T: [1x1 struct]
D: {[1x1 struct]}
dec.T
ans =
type: 'trend'
breaks: 2
kmin: 1
amplitudes: [1.5000 -0.5000 0 -2]
dec.D{1}
ans =
type: 'detail'
breaks: 2
kmin: 1
amplitudes: [-0.5000 0.5000 0 -2]
dec.D{2}=D
dec =
T: [1x1 struct]
D: {[1x1 struct] [1x1 struct]}
S
S =
type: 'trend'
breaks: 1
kmin: 2
amplitudes: [1 2 0 -1 0 0 -4]
haardec(S)
{Error using haardec (line 11)
Not enough input arguments.
}
haardec(S,1)
ans =
T: {[1x1 struct]}
D: {[1x1 struct]}
haardec(S,2)
ans =
T: {[1x1 struct] [1x1 struct]}
D: {[1x1 struct] [1x1 struct]}
plot(t,haarplot(S,t),t,haarcomp(haardec(S,1)),'*')
{Error using haarcomp (line 9)
Not enough input arguments.
}
plot(t,haarplot(S,t),t,haarcomp(haardec(S,1),t),'*')
plot(t,haarplot(S,t),t,haarcomp(haardec(S,2),t),'*')
plot(t,haarplot(S,t),t,haarcomp(haardec(S,3),t),'*')
haardec(S,2)
ans =
T: {[1x1 struct] [1x1 struct]}
D: {[1x1 struct] [1x1 struct]}
haardec(S,3)
ans =
T: {1x3 cell}
D: {1x3 cell}
a=imread('arena.png');
size(a)
ans =
512 1024
a(1,1:10)
ans =
Columns 1 through 7
195 194 194 194 194 195 195
Columns 8 through 10
194 194 193
image(a)
colormap(gray(256))
image(a)
colormap(pink(256))
image(a)
a(1,1:10)
ans =
Columns 1 through 7
195 194 194 194 194 195 195
Columns 8 through 10
194 194 193
a(1,1)
ans =
195
a(1,1)*2
ans =
255
[aT,aD,A,B,C]=imagetrenddetail(a);
image(aT)
figure
image(a)
colormap(pink(256))
image(a)
image(aD)
close all
image(aD)
colormap(pink(256))
image(aD)
aT+aD
{Error using +
Matrix dimensions must agree.
}
zoomtred(aT)+aD
{Undefined function 'zoomtred' for
input arguments of type 'double'.
}
119 134 126 130
zoomtrend(aT)+aD-a
{Error using -
Integers can only be combined with
integers of the same class, or scalar
doubles.
}
norm(zoomtrend(aT)+aD-double(a))
ans =
0
image(A)
image(B)
image(A)
image(B)
figure
image(A)
colormap(pink(256))
image(A)
gray(16)
ans =
0 0 0
0.0667 0.0667 0.0667
0.1333 0.1333 0.1333
0.2000 0.2000 0.2000
0.2667 0.2667 0.2667
0.3333 0.3333 0.3333
0.4000 0.4000 0.4000
0.4667 0.4667 0.4667
0.5333 0.5333 0.5333
0.6000 0.6000 0.6000
0.6667 0.6667 0.6667
0.7333 0.7333 0.7333
0.8000 0.8000 0.8000
0.8667 0.8667 0.8667
0.9333 0.9333 0.9333
1.0000 1.0000 1.0000
showdec(a);
wavemenu
diary off