I have data that I'm using for a wind turbine project. The project requires that I retrieve data from an excel sheet that was supplied of experimentally tested values for lift and drag. These values for lift and drag are based on a value alpha (an angle, but irrelevant to the coding question).(adsbygoogle = window.adsbygoogle || []).push({});

Right now, I have used Excel's line of best fit approximation (using a 6th degree polynomial) along with different if statements to get the values, but I've found that there can be up to 30% error in some calculations. Instead, I'd like to import the data to excel and use Matlab's interpolate function to find these values.

The only problem is... I have no clue how to go about importing the data to excel or how to use the interpolate function. My Matlab experience is literally non-existent. I have minor experience in Java but that's it.

What's the easiest way to import the data from excel, and what functions can I use to interpolate the data? Thanks!

Here's the code I'm trying to replace:

Code (Text):

%FINDING CL

if(alpha>0 && alpha <= 8)

Cl = -0.0001*alpha^5 + 0.0016*alpha^4 - 0.0093*alpha^3 + 0.0219*alpha^2 + 0.0928*alpha + 0.0006;

elseif(alpha > 8 && alpha <= 27)

Cl = -.00001*alpha^2 + 0.0542*alpha - 0.5037;

elseif(alpha > 27 && alpha <= 90)

Cl = -.00000009*alpha^4 + .00003*alpha^3 - 0.0036*alpha^2 + 0.1761*alpha - 1.8521;

else

Cl=0;

end

%FINDING CD

if(alpha >= 0 && alpha <= 8)

Cd = -.00001*alpha^3 + 0.0003*alpha^2 - 0.0003*alpha + 0.0134;

elseif(alpha > 8 && alpha <= 90)

Cd = -.0000000004*alpha^5 + .0000002*alpha^4 - .00003*alpha^3 + 0.0018*alpha^2 - 0.0196*alpha + 0.1616;

else

Cd = 0;

end

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab - importing data from excel & interpolating

Loading...

Similar Threads for Matlab importing data |
---|

Binary bitstream from QPSK with MATLAB? |

Python How can I run Python by getting values from Matlab |

What is each step of this Matlab program doing? |

C/++/# Help with MATLAB code? |

Numerical Integration with variable limits MATLAB |

**Physics Forums | Science Articles, Homework Help, Discussion**