-
Notifications
You must be signed in to change notification settings - Fork 42
/
Test_Load_Airfoil_Function.m
44 lines (37 loc) · 1.12 KB
/
Test_Load_Airfoil_Function.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
44
% TESTING THE LOAD_AIRFOIL.M FUNCTION
% Written by: JoshTheEngineer
% Started : 01/17/19
% Updated : 01/17/19 - Started code
% - Works as expected
clear;
clc;
% Define filepath and all filenames in that path
flpth = '.\Airfoil_DAT\';
% flpth = '.\Airfoil_DAT_Selig\';
flnms = dir(flpth);
% Extract the filenames from the 'flnms' structure
for i = 1:1:length(flnms)-2
flnmArr{i,1} = flnms(i+2).name(1:end-4);
end
% Loop through all files and find good/bad airfoils
goodFoil = [];
badFoil = [];
for kk = 1:1:length(flnmArr)
fprintf('Iteration: %i/%i\n',kk,length(flnmArr));
fprintf('\tFile: %s\n',flnmArr{kk});
try
[dataX,dataY] = LOAD_AIRFOIL(flnmArr{kk});
% [dataX,dataY] = LOAD_AIRFOIL_SELIG(flnmArr{kk});
goodFoil = [goodFoil; flnmArr(kk)];
% Plot the airfoil
figure(1);
cla; hold on; grid on;
set(gcf,'Color','White');
plot(dataX,dataY,'ko-');
xlim([0 1]);
ylim('auto');
axis equal;
catch
badFoil = [badFoil; flnmArr(kk)];
end
end