CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   xfoil with matlab (

nikolaous June 1, 2010 11:24

xfoil with matlab
hello guys,
does anyone know how can i use matlab in order to run simulations with xfoil ? i want to open xfoil from matlab, attach a file which includes all the commands needed by xfoil (for example naca2212 ,oper, visc,3e4,mach0.2,alfa0,cpwr etc) and change one parameter (probably alfa) in order to run for different input. As it is time consuming to make it manually, changing a little bite one parameter each time, i would be really grateful if anyone could tell me how can i make this.thank you

CAVT August 17, 2010 12:05

I know MatLab has the ability to run Fortran and C++ codes if you specify the correct compiler (for example g++ or gfortran). That appears in MatLabs help, but unfortunately I've never tried it.
Now, depending on your simulation, an available airfoil code for MatLab is PABLO, it was programmed at the KTH in Sweden. It's not as powerful as XFoil but it may suite your needs. It's under GPL license.

TheBeefBaron August 24, 2010 18:03

This guy has it figured out
This guy has linked matlab to xfoil successfully. I've adapted his code to work with non-symmetric airfoils.

Just download his code and follow the function calls. It calls a batch script which calls a .vbs script I think. Let me know how it goes.

DoHander September 2, 2010 14:15


If you have a text file with all the inputs Xfoil needs in order to do a simulation you can simply call Xfoil in a Matlab session just like you do in a Dos window. You need to have Xfoil in your path, say your Xfoil commands are stored in "Session.txt" then you can start Xfoil from Matlab this way:

!xfoil < Session.txt

If you need specific help send me a message.


All times are GMT -4. The time now is 05:15.