Error while executing a MATLAB function block.

1 次查看(过去 30 天)
I tried to generate the switching signals via using the power signals with the help of MATLAB function block.
Aftre running the simulation i found the errors like below:
  1. Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks. Use 'mex -setup' to select a supported C-compiler.

回答(1 个)

Walter Roberson
Walter Roberson 2020-9-26
The first one on the list can only be used if you are using 32 bit Windows version of MATLAB.
The second one, SDK 7.1, can be difficult to install if you are using Windows 10.
The other ones are commercial (not free). You cannot use any of the Visual Studio "Express" or "Community" editions for a release that old: SDK 7.1 was the "Community" edition of those days.
Once you have installed a compiler (or chosen to use lcc), go to the MATLAB command line and command
mex -setup -v
and follow the prompts to register your compiler with MATLAB. If you run into problems, post the output of the mex -setup -v operation.
  2 个评论
Walter Roberson
Walter Roberson 2020-9-26
For this purpose what is important is not whether your operating system is 64 bit, but rather whether you are running the 64 bit version of MATLAB. When you are running a 64 bit versions of Windows, you could run either the 32 bit or 64 bit version of MATLAB, at least up to R2015b.
Anyhow, if you are using the 64 bit version of MATLAB then your options are SDK 7.1, or one of the commercial compilers listed in the link above.
Installing SDK 7.1 on Windows 7 is not bad (though sometimes you needed to uninstall .NET and install SDK 7.1 and then reinstall .NET), but installing SDK 7.1 on Windows 10 can be a challenge.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息

产品


版本

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by