From: GeoGraphic on
"Matthew Lenda" <lendam(a)gmail.com> wrote in message <higkap$mej$1(a)fred.mathworks.com>...
> "Matthew Lenda" <lendam(a)gmail.com> wrote in message <hig6vo$g7t$1(a)fred.mathworks.com>...
> > Hey all,
> >
> > I'm running an autopilot simulation in Simulink, and it requires the use of some very fancy nonlinear equations of motion and vector field stuff. Rather than turning these equations into block diagram form, I already had the code written up for them and decided to use them in an embedded function block.
> >
> > Well, running the simulation directly in Simulink or using the sim.m function in an m-file both return the following error:
> >
> > "Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds.
> > Use 'mex -setup' to select a supported compiler."
> >
> > When I run "mex -setup", it says there are no compilers to choose from.
> >
> > There are lots of embedded functions that I wish to use in this simulation so there isn't an obvious workaround. I've got lots of other Simulink sims (state space stuff, some other randoms) that do not use embedded MATLAB code blocks, and they run just fine.
> >
> > Need-to-knows...
> > -I am running 64-bit MATLAB
> > -My OS is 64-bit Windows 7
> > -I know little to nothing about compilers.
> > -I have pretty much every blockset you can imagine for Simulink (thank you, university licenses!)
> >
> > Let me know if you need any other information.
>
>
> With the help of a friend, I got the correct compiler in place. Running the sim from an m-file using "sim.m", I get the following output in the Command Window.
>
> Embedded MATLAB parsing for model "cupic_simulator"...Done
> Embedded MATLAB code generation for model "cupic_simulator"....Done
> Embedded MATLAB compilation for model "cupic_simulator"... 1 file(s) copied.
> Done
> ??? Error using ==> cupic_simulator_script at 56
> Error reported by S-function 'sf_sfun' in 'cupic_simulator/Nonlinear Equations of Motion (Embedded Function)/ SFunction ':
> Error calling generated SFunction, cupic_simulator_sfun.
>
> So it looks like I got a bit further, but now it just won't tell me what's wrong with the function.
>
> I tried a very simple simulation/model with a very simple embedded function -- same error.

I have the same exact problem. Has anyone ever figured this out?
From: Matthew Lenda on
The issue was that I needed the Windows Visual Studio 2008. It has the proper *things* to run embedded code in Simulink. Go get it!

I only found out about this because a buddy of mine ran into the same problem when working on similar things. I would have had no idea otherwise!



"GeoGraphic " <blazingfury31(a)yahoo.com> wrote in message <hqtc4f$re2$1(a)fred.mathworks.com>...
> "Matthew Lenda" <lendam(a)gmail.com> wrote in message <higkap$mej$1(a)fred.mathworks.com>...
> > "Matthew Lenda" <lendam(a)gmail.com> wrote in message <hig6vo$g7t$1(a)fred.mathworks.com>...
> > > Hey all,
> > >
> > > I'm running an autopilot simulation in Simulink, and it requires the use of some very fancy nonlinear equations of motion and vector field stuff. Rather than turning these equations into block diagram form, I already had the code written up for them and decided to use them in an embedded function block.
> > >
> > > Well, running the simulation directly in Simulink or using the sim.m function in an m-file both return the following error:
> > >
> > > "Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds.
> > > Use 'mex -setup' to select a supported compiler."
> > >
> > > When I run "mex -setup", it says there are no compilers to choose from.
> > >
> > > There are lots of embedded functions that I wish to use in this simulation so there isn't an obvious workaround. I've got lots of other Simulink sims (state space stuff, some other randoms) that do not use embedded MATLAB code blocks, and they run just fine.
> > >
> > > Need-to-knows...
> > > -I am running 64-bit MATLAB
> > > -My OS is 64-bit Windows 7
> > > -I know little to nothing about compilers.
> > > -I have pretty much every blockset you can imagine for Simulink (thank you, university licenses!)
> > >
> > > Let me know if you need any other information.
> >
> >
> > With the help of a friend, I got the correct compiler in place. Running the sim from an m-file using "sim.m", I get the following output in the Command Window.
> >
> > Embedded MATLAB parsing for model "cupic_simulator"...Done
> > Embedded MATLAB code generation for model "cupic_simulator"....Done
> > Embedded MATLAB compilation for model "cupic_simulator"... 1 file(s) copied.
> > Done
> > ??? Error using ==> cupic_simulator_script at 56
> > Error reported by S-function 'sf_sfun' in 'cupic_simulator/Nonlinear Equations of Motion (Embedded Function)/ SFunction ':
> > Error calling generated SFunction, cupic_simulator_sfun.
> >
> > So it looks like I got a bit further, but now it just won't tell me what's wrong with the function.
> >
> > I tried a very simple simulation/model with a very simple embedded function -- same error.
>
> I have the same exact problem. Has anyone ever figured this out?
From: Christopher on
"Matthew Lenda" <lendam(a)gmail.com> wrote in message <hqtdhh$orc$1(a)fred.mathworks.com>...
> The issue was that I needed the Windows Visual Studio 2008. It has the proper *things* to run embedded code in Simulink. Go get it!
>
> I only found out about this because a buddy of mine ran into the same problem when working on similar things. I would have had no idea otherwise!

Hi Matthew,

I was wondering what you did to solve this. I'm having the same problem at the moment, but I've installed the MS SDK (x64 compilers) and MS Visual Studio 2008, but I still can't get things to work. See my posts on the related thread:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/270052

Chris
From: Matthew on
"Christopher " <christopher.mayhew(a)gmail.com> wrote in message <hrs4tk$6kl$1(a)fred.mathworks.com>...
> "Matthew Lenda" <lendam(a)gmail.com> wrote in message <hqtdhh$orc$1(a)fred.mathworks.com>...
> > The issue was that I needed the Windows Visual Studio 2008. It has the proper *things* to run embedded code in Simulink. Go get it!
> >
> > I only found out about this because a buddy of mine ran into the same problem when working on similar things. I would have had no idea otherwise!
>
> Hi Matthew,
>
> I was wondering what you did to solve this. I'm having the same problem at the moment, but I've installed the MS SDK (x64 compilers) and MS Visual Studio 2008, but I still can't get things to work. See my posts on the related thread:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/270052
>
> Chris
From: Christopher on
"Matthew " <lendam(a)gmail.com> wrote in message <hrs6ak$b7f$1(a)fred.mathworks.com>...
> "Christopher " <christopher.mayhew(a)gmail.com> wrote in message <hrs4tk$6kl$1(a)fred.mathworks.com>...
> > "Matthew Lenda" <lendam(a)gmail.com> wrote in message <hqtdhh$orc$1(a)fred.mathworks.com>...
> > > The issue was that I needed the Windows Visual Studio 2008. It has the proper *things* to run embedded code in Simulink. Go get it!
> > >
> > > I only found out about this because a buddy of mine ran into the same problem when working on similar things. I would have had no idea otherwise!
> >
> > Hi Matthew,
> >
> > I was wondering what you did to solve this. I'm having the same problem at the moment, but I've installed the MS SDK (x64 compilers) and MS Visual Studio 2008, but I still can't get things to work. See my posts on the related thread:
> > http://www.mathworks.com/matlabcentral/newsreader/view_thread/270052
> >
> > Chris

I'm sorry Matthew, did you mean to reply to my post? There is a blank message from you here.