-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrandWatson_test.m
44 lines (37 loc) · 1006 Bytes
/
randWatson_test.m
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
41
42
43
clear;
mu = [0,0,1];
k=35;
N=1000;
[RandWatson] = randWatson(N, mu, k);
figure;
scatter3(RandWatson(:,1), RandWatson(:,2), RandWatson(:,3),3, 'b', 'filled'), axis([-1 1 -1 1 -1 1]);
clear;
mu = [0,0,1];
k=500;
N=1000;
[RandWatson] = randWatson(N, mu, k);
figure;
scatter3(RandWatson(:,1), RandWatson(:,2), RandWatson(:,3),3, 'b', 'filled'), axis([-1 1 -1 1 -1 1]);
clear;
mu = [0,0,1];
k=0;
N=1000;
[RandWatson] = randWatson(N, mu, k);
figure;
scatter3(RandWatson(:,1), RandWatson(:,2), RandWatson(:,3),3, 'b', 'filled'), axis([-1 1 -1 1 -1 1]);
% Generate the cover image of MATLAB central.
clear;
mu = [1,-1,-1];
mu = mu / norm(mu);
k=-15;
N=1000;
[RandWatson] = randWatson(N, mu, k);
figure;
scatter3(RandWatson(:,1), RandWatson(:,2), RandWatson(:,3),3, 'b', 'filled'), axis([-1 1 -1 1 -1 1]);
mu = [1,-1,-1];
mu = mu / norm(mu);
k=30;
N=1000;
[RandWatson] = randWatson(N, mu, k);
hold on;
scatter3(RandWatson(:,1), RandWatson(:,2), RandWatson(:,3),3, 'r', 'filled'), axis([-1 1 -1 1 -1 1]);