From: Bowman, D. S. <sb...@mi...> - 2009-02-04 13:34:27
|
Jon, the only way that I know of for Matlab to interact with C/C++ code is for that code to be compiled into a DLL (called a mex-file in Mathworks parlance) that gets called from Matlab. Basically, The Mathworks provides a header file that prototypes the interface and then the user writes the actual code to implement the interface. Then, one compiles it (gcc, vc, or Mathwork's lcc) and calls it from Matlab. For smaller codes, the interface is simple and easy to create. For JSBSim, I think it would be more complicated. (I've wanted to do it with JSBSim, but nothing is pushing it for me right now which means it just won't get done. :) ) The other option, of course, is one that you wrote about in an old issue of "Back of the Envelope" in which one would use network interfaces to accomplish the data transfer. >From the perspective of compiling JSBSim into a Matlab-capable DLL, I think that making the Run method virtual would help. But, I should point out that I'm no expert in this area! -sb -----Original Message----- From: Jon S. Berndt [mailto:jon...@co...] Sent: Tuesday, February 03, 2009 12:00 PM To: jsb...@li... Subject: [Jsbsim-matlab] Flight Control code One thing I've wondered is if it would be helpful to make the FGFCS (flight control manager) code "virtual" so that perhaps a different Run() method could be built that would somehow "call" Matlab/Simulink, so that control code generated there could drive JSBSim instead of the normal FGFCS::Run() method. It wouldn't even have to me Matlab that was "called" (which I don't know if that's even possible), but instead perhaps some autogenerated code could be in the derived ::Run() method. Just a thought. Jon ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Jsbsim-matlab mailing list Jsb...@li... https://lists.sourceforge.net/lists/listinfo/jsbsim-matlab |