S-function does not exist error!
Mostra commenti meno recenti
I am trying to test this Matlab model which uses a random signal generator and both a Matlab based S-function block (a dot m file) and a C code based S-function block ( dot c file).When I run this model, I get the following error:

I tried to find solutions for a while and realised that the MEX file in that folder is probably what the s-function block uses to utilise the C-code. I also found out that the MEX file in that folder may not be compatible with my version of Matlab. As a result, I tried to use the "mex" command:
mex secondOrder_c.c)
That gave me the following error:
Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler;
see Install MinGW-w64 Compiler. For more options, visit
http://www.mathworks.com/support/compilers/R2017a/.
I'd appreciate some help with this process. Is this happening to me because my computer has no C/C++ compilers installed? I have Visual Studio 2017 installed on the same computer. Doesn't that count for anything? Does the fact that Matlab didn't detect that software imply that it's useless?
I'd really like some help with this so that I can resume learning from the book where I came across this s-function thing.
Risposta accettata
Più risposte (1)
Fangjun Jiang
il 19 Set 2018
0 voti
run "mex -setup" to select VC2017 as the compiler and then run mex.
6 Commenti
Mahmud Khan
il 19 Set 2018
Fangjun Jiang
il 19 Set 2018
That is strange. VC 2017 is supposed to be supported by MATLAB R2017a. Follow that link and try installing the free MinGW.
Mahmud Khan
il 19 Set 2018
Modificato: Mahmud Khan
il 19 Set 2018
sreedevi
il 5 Feb 2019
could you please tell me how you solved it, i am also facing the same issue
Mahmud Khan
il 7 Feb 2019
MAYOWA OLADELE
il 10 Gen 2023
I also used that answer but I'm still getting the same error
Categorie
Scopri di più su Troubleshooting in MATLAB Compiler SDK in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!