using cscript.exe and vvbs script for file-stored inputs
- From: Adam Chapman <adam.chapman@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Oct 2008 05:23:44 -0700 (PDT)
Hi,
Im doing some weird stuff with somthing called cscript (http://
technet.microsoft.com/en-us/library/bb490887.aspx), which basically
reads inputs from a file instead of waiting for a user to type them
in.
Im using the same software setup as the guy at (http://
people.bath.ac.uk/zw215/research.html).
He gets a Matlab file to write a .vbs script. The vbs script holds the
inputs in it for cscript.exe to use.
The vbs script looks something like:
Wscript.Stdout.WriteLine "naca 4412"
Wscript.Sleep 20
Wscript.Stdout.WriteLine "pane"
Wscript.Sleep 20
Wscript.Stdout.WriteLine "oper"
Wscript.Sleep 20
(the writeline statements make the inputs, the sleep statements cause
a pause between inputs)
He then runs a .bat file from matlab with the line:
!Name_of_bat_file.bat
The .bat file reads:
Cscript.exe //NoLogo test2.vbs | xfoilP4.exe
So basically cscript gets the inputs from test2.vbs and inputs them to
the user interface of xfoil.exe
I think that's really clever, I wish it was my idea! This way you can
write vbs scritps with fprintf to modify inputs and run the executable
many times. In this example, xfoil is an aerodynamics code, and i can
make different aerofoil shapes in matlab, changing a single input in
the vbs script for each aerofoil automagically. You could even leave
it running for a few days if you wanted. The really neat thing about
it is that you don't even need to interface other language code with
matlab, so no problems with reading other programming languages or ven
understanding someone elses code for that matter.
Just thought I'd share that little gem.
Adam
.
- Prev by Date: Pass a matrix or vector from a standard function
- Next by Date: Re: Please help!!!
- Previous by thread: Pass a matrix or vector from a standard function
- Next by thread: Re: PIC18F4550 control with USB
- Index(es):
Relevant Pages
|