-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateQTVarSurf.m
More file actions
42 lines (30 loc) · 881 Bytes
/
Copy pathCreateQTVarSurf.m
File metadata and controls
42 lines (30 loc) · 881 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
41
function [ surf ] = CreateQTVarSurf( var)
QTGlobals
fprintf('Generating Surface (%i): \n',var);
x = zeros(1,nBlocks);
y = zeros(1,nBlocks);
v = zeros(1,nBlocks);
fprintf('\tBlocks ');
for b=1:nBlocks
if mod(b,500) == 0, fprintf('... %i',b); end
if mod(b,3500) == 0, fprintf('\n\t\t'); end
x(b) = Blocks{b}.x;
y(b) = Blocks{b}.y;
v(b) = Blocks{b}.data(var);
end
fprintf('\n');
fprintf('\tBoundaries ');
for b=1:nBlocks
if mod(b,500) == 0, fprintf('... %i',b); end
if mod(b,3500) == 0, fprintf('\n\t\t'); end
if ~Blocks{b}.br(RIGHT) || ~Blocks{b}.br(LEFT) || ...
~Blocks{b}.br(DOWN) ||~Blocks{b}.br(UP)
[x,y,v] = AddQTBlockSurfacePnts(Blocks{b},x,y,v,var);
end
end
fprintf('\n\tGenerating Surface');
[d,c] = unique([x',y'],'rows');
v = v(c);
surf = fit(d,v','cubicinterp');
fprintf('... done\n');
end