![]() ![]() You saw in my previous blog that high order polynomials can have some problems. ![]() Do the Interpolation and Plot the Result. ![]() ![]() This should work: % For finding the lift curve slope across a wing Once you have the coordinates of the measurements and the measurements themselves, you can then use interp1 to interpolate the values between the actual measurements. It looks like your measurements are defined to be equally spaced between 0 and semispan, in which case you can make a vector of N equally spaced coordinates between (and including) those values using linspace(0, semispan, N). The solution is to make up a coordinate vector that gives the positions of the measurements given by the user and then use interp1.įor example, suppose you have three measurements, at points 0, 0.5, and 1-then the coordinate vector would be. % For finding the lift curve slope across a wingĬ_L = % from a user input at stations which equally subdivide the wing.Ĭ_L = interp1(C_L,x,'linear','extrap') % Don't know how to do this part correctly. Simplified example, I hope this makes it clearer, the new C_L should still end with 0.0 and still start with 1.4, then the first lot of new numbers must be interpolated so that they are between 1.4 and 1.6, the next set between 1.6 and 1.7, and so on. I'm trying to use interp1 function but can't see a way to make it work. I need to generate interpolated values for the smaller vector so that it and the larger vector are the same size. Essentially I have one vector which contains a large number of elements and another vector that contains fewer elements which correspond to the elements in the larger vector.Į.g if my short vector had two elements these would correspond to the first and last elements in the larger vector, if three were in the small these would correspond to the first middle and last elements of the larger vector. Hi I'm having some trouble getting two vectors to be the same size. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |