-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathA91_test_data.m
More file actions
68 lines (55 loc) · 1.48 KB
/
Copy pathA91_test_data.m
File metadata and controls
68 lines (55 loc) · 1.48 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%% per vedere i dati dell'esempio usare il comando
%% out = A91_test_data (nin, nplot)
%% for ii = 1 : size (out, 1)
%% figure
%% plot3 (out{ii, 1}(1, :), out{ii, 1}(2, :), out{ii, 1}(3, :), 'o',
%% out{ii, 2}(1, :), out{ii, 2}(2, :), out{ii, 2}(3, :));
%% end
function out = A91_test_data (nin, nplot)
xin = linspace (-5, 5, nin);
xplot = linspace (-5, 5, nplot);
out{1, 1} = [xin; runge(xin); zeros(size (xin))];
out{1, 2} = [xplot; runge(xplot); zeros(size (xplot))];
xin = linspace (0, 1, nin);
xplot = linspace (0, 1, nplot);
[x, y, z] = circle (xin);
out{2, 1} = [x; y; z];
[x, y, z] = circle (xplot);
out{2, 2} = [x; y; z];
xin = linspace (0, 5, nin);
xplot = linspace (0, 5, nplot);
[x, y, z] = helix (xin);
out{3, 1} = [x; y; z];
[x, y, z] = helix (xplot);
out{3, 2} = [x; y; z];
xin = linspace (0, 1, nin);
xplot = linspace (0, 1, nplot);
[x, y, z] = crown (xin);
out{4, 1} = [x; y; z];
[x, y, z] = crown (xplot);
out{4, 2} = [x; y; z];
end
function y = runge (x)
y = 1 ./ (1 + x.^2);
end
function [x, y, z] = circle (theta)
R = 10;
x = R * cos (2 * pi * theta);
y = R * sin (2 * pi * theta);
z = zeros (size (theta));
end
function [x, y, z] = helix (theta)
R = 10;
P = 2;
x = R * cos (2 * pi * theta);
y = R * sin (2 * pi * theta);
z = P * theta;
end
function [x, y, z] = crown (theta)
R = 10;
P = 2;
omega = 9;
x = R * cos (2 * pi * theta);
y = R * sin (2 * pi * theta);
z = sin (2*pi*omega*theta);
end