Comparing Data to find third set of data

Here is part of my code that I am having problems with: The induced angle is currently 21 different values across the wing span (the alpha is currently fixed). I want to compare the angle_eff with values from excel files to obtain the coefficient of lift. I am able to match the angle_eff with the first column of excel data (alpha), but then I need it to take the corresponding lift coef. as it's value. Part of the excel data is provide below followed by the code. Can anyone help? If you wish to view the entire code just ask.
alpha Lift Coef.
0 0
1 0.11
2 0.22
3 0.33
4 0.44
5 0.55
6 0.66
7 0.77
8 0.88
9 0.99
10 1.0685
angle_eff = (alpha - induced_angle);
figure(6)
plot(y,angle_eff)
%read data in
val1 = xlsread('NACA0015.xlsx');
c1 = val1(:,1);
angle_eff_round = round(angle_eff);
display(c1)
c2 = val1(:,2);
%display(angle_eff_round)
num = length(c1);
for i = 1:num
cl_new = ismember(c1,angle_eff_round);
%if cl_new == true
%end
end
%figure(7) %plot(y,cl_new)

2 Comments

Having difficulty figuring out what the problem is. Can you explain the process that you need, but is not working, in the simplest way?
If you want angle_eff to take the lift coefficient as its value why are you setting it equal to alpha - induced angle? Why not just write angle_eff = c2 (as you defined it in the code)?
Sorry I am not very good at explaining problems so let me try again:
(1) The induced_angle is calculated through some numerical methods and varies at different iterations across the wingspan.
(2) Example lets say that at some point along the wing the angle_eff is calculated to be 5.8, the code rounds the value to 6 as seen above
(3) I then want my code to match the 'alpha' excel data and the calculated angle_eff and take the corresponding lift Coef., which in this example of 6 would be .66
Hope this makes more sense.

Sign in to comment.

 Accepted Answer

You should abstract your problem into a mathematical or MATLAB programming problem. Don't let the details of your application obscure the problem. I'll take a guess using the following example:
A=[0 0
1 0.11
2 0.22
3 0.33
4 0.44
5 0.55
6 0.66
7 0.77
8 0.88
9 0.99
10 1.0685];
c=1:2:10
index=ismember(A(:,1),c)
SelectedData=A(index,2)
c =
1 3 5 7 9
index =
0
1
0
1
0
1
0
1
0
1
0
SelectedData =
0.1100
0.3300
0.5500
0.7700
0.9900

1 Comment

Thanks, Fangjun! As you can tell my programming skills are lacking.

Sign in to comment.

More Answers (0)

Categories

Find more on Aerospace Applications in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!