-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_disk.m
More file actions
40 lines (28 loc) · 913 Bytes
/
gen_disk.m
File metadata and controls
40 lines (28 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [ w ] = gen_disk( size_e , ep , sti ,categ)
switch categ
case 'disk'
% Create a meshgrid to
[ X , Y ] = meshgrid( linspace( -1 , 1, size_e));
disk = zeros( size_e , size_e);
% Create a disk
theresold = (( size_e - 80 ) - 36)/size_e ;
panel = X.^2 + Y.^2;
[index] = find(panel < theresold);
disk(index) = 1;
% Create a 4-D
for xx =1: ep
for yy = 1:sti
w(: , : , xx, yy) = disk;
end
end
case 'gauss'
% Generate a guass filter
gau = fspecial('gauss' , size_e, size_e/2);
% Turn this filter into 3-D
for xx =1: ep
for yy = 1: sti
w(: , : , xx, yy) = gau;
end
end
end
end