Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 80

Thread: XFOIL with MATLAB

  1. #11
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by nikolhs View Post
    hello,
    the code which is above ( Perl script generating an XFOIL script) doesn't run with matlab.When i paste it in a blank .m file, they appear many red marks, which means that's something wrong happens.
    If you could explain what exactly i should do (and by this i mean the correct sequence of the files that i have to create etc) i would be really grateful.
    The Perl script should be in a .pl file, not a .m file. The MATLAB command to run the Perl script is perl(), and the m-file you create will be calling perl() to run the Perl script. Run help perl at the MATLAB command line for more information.

  2. #12
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    hi,
    i have created a .pl file includes the code that begins with: " #!/usr/bin/perl " and one other .m file (the matlab function calling the wrapper) but when i run the .m file it appears this message :
    Input argument "alfa" is undefined.

    Error in ==> codexfoil at 12
    alfa = sprintf('%.5f', alfa);

    is't it already defined ? what should i do ? i suspect that this problem will arise for the other variables too (mach etc)...please reply

  3. #13
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    what is more, xfoilP4.exe should be in the same folder with the previous files?please answer both...

  4. #14
    Join Date
    Jun 2010
    Beans
    3

    Re: XFOIL with MATLAB

    Dear all,

    I'm facing exactly the same problem with Nikolhs. Also, now i have to xfoilwrapper.pl and get_coeff.m, but when i tried running it, i got this msg:

    System error: Can't locate warnings.pm in @INC in Matlab.

    I have no knowledge in perl at all...Would you plzz tell us exactly what to do?


    Thanks sooooo much in advance

  5. #15
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by nikolhs View Post
    hi,
    i have created a .pl file includes the code that begins with: " #!/usr/bin/perl " and one other .m file (the matlab function calling the wrapper) but when i run the .m file it appears this message :
    Input argument "alfa" is undefined.

    Error in ==> codexfoil at 12
    alfa = sprintf('%.5f', alfa);

    is't it already defined ? what should i do ? i suspect that this problem will arise for the other variables too (mach etc)...please reply
    Hi nikolhs,

    The M-file is a function, and notice that its first argument is alfa. You need to supply the input arguments to the function.

    Read the first comments in get_coeffs.m to understand the exact syntax needed.

    Quote Originally Posted by nikolhs View Post
    what is more, xfoilP4.exe should be in the same folder with the previous files?please answer both...
    So I suppose you're using Windows, then? Note that the code was built for Linux and as such I can't guarantee that it'll work in Windows. If you look at the Perl code, you'll see that it expects the location of the executable to be at C:\xfoil\bin\xfoil.exe .
    Last edited by azredwing; June 8th, 2010 at 08:48 PM.

  6. #16
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by kazz81 View Post
    Dear all,

    I'm facing exactly the same problem with Nikolhs. Also, now i have to xfoilwrapper.pl and get_coeff.m, but when i tried running it, i got this msg:

    System error: Can't locate warnings.pm in @INC in Matlab.

    I have no knowledge in perl at all...Would you plzz tell us exactly what to do?


    Thanks sooooo much in advance
    Hi kazz81,

    What version of MATLAB are you using? I also suppose that you're running Windows, since MATLAB for Linux uses the Perl implementation that comes stock with the OS. In any case, try putting a # in front of the line:
    Code:
    use warnings;
    This will prevent Perl from loading the apparently non-existent "warnings" module and bombing out.

    I just tried running a rudimentary Perl script using MATLAB for Windows, though, and it worked fine.

  7. #17
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    If there's enough interest, I could rewrite these scripts to be more general-purpose and have standard releases or something; I suppose aerospace engineers don't typically have the programming skills required to do this type of stuff. Let me know if you'd like to see this.

  8. #18
    Join Date
    Jun 2010
    Beans
    3

    Re: XFOIL with MATLAB

    Hey azredwing,

    Thank u very much for your help...

    I've tried putting # in front of "use warnings", and that worked ok, but then these lines occured:

    ??? Error using ==> perl
    System error: Too many arguments for open at xfoilwrapper.pl line 34, near "or"
    Too many arguments for open at xfoilwrapper.pl line 62, near "or"
    Too many arguments for open at xfoilwrapper.pl line 108, near "or"
    Too many arguments for open at xfoilwrapper.pl line 133, near "or"
    Execution of xfoilwrapper.pl aborted due to compilation errors.
    Command executed: perl xfoilwrapper.pl 10.00000 3000000 1.00000 0012

    I have no idea what happened here....

    Your help would be much appreciated.. thank u again!

    (P.S. About the general purpose code that you said you would write?, would 2 interests be enough..me and nikolhs? )

  9. #19
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by kazz81 View Post
    Hey azredwing,

    Thank u very much for your help...

    I've tried putting # in front of "use warnings", and that worked ok, but then these lines occured:

    ??? Error using ==> perl
    System error: Too many arguments for open at xfoilwrapper.pl line 34, near "or"
    Too many arguments for open at xfoilwrapper.pl line 62, near "or"
    Too many arguments for open at xfoilwrapper.pl line 108, near "or"
    Too many arguments for open at xfoilwrapper.pl line 133, near "or"
    Execution of xfoilwrapper.pl aborted due to compilation errors.
    Command executed: perl xfoilwrapper.pl 10.00000 3000000 1.00000 0012

    I have no idea what happened here....

    Your help would be much appreciated.. thank u again!
    Again, what version of MATLAB are you running, and on what OS? It looks like your Perl interpreter is an older one, that doesn't support the relatively more recent 3-argument version of open(). (Now that I think of it, this is probably why use warnings; threw an error as well.)

    (P.S. About the general purpose code that you said you would write?, would 2 interests be enough..me and nikolhs? )
    I am working on it The lab that I work in is also pretty interested in this... I can't say it'll be out any time soon, but I am definitely going to do it.

  10. #20
    Join Date
    Jun 2010
    Beans
    3

    Re: XFOIL with MATLAB

    Hey azredwing,

    I"m running Matlab 7.0 on window xp. and since i don't know Perl at all,
    I also have ActivePerl 5.9.9 build 519 installed, but when i copied your
    Perl code, i did it in notepad and save it as .pl

    Do I need to update my matlab or anything?

    Thanks in advance.

Page 2 of 8 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •