%% airfoil_geo.m % Read polar file and output required variables. If CLMax is not reached, % output empty variables. function [x y] = airfoil_geo(fname) output = [0 0]; n = 0; try outid = fopen(fname); while 1 n = n+1; outline = fgetl(outid); if ~ischar(outline), break, end if n>1 output(n-1,:) = str2num(outline); end end x = output(:,1); y = output(:,2); fclose(outid); catch x = [];y = []; fclose('all'); return end cmax = max(y); if ~(cmax>y(length(y))) x = []; y = []; return end