Does @(x) matlab function exist in C language ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Pierre-Olivier Desrosiers
il 5 Lug 2022
Commentato: Steven Lord
il 5 Lug 2022
Hey guys, I'm currently working on a standalone app and I have to write my s-function in C language. I also have the s-function written in Matlab and I use the @(x) function. Thus, I was wondering if this function exist in C language?
0 Commenti
Risposta accettata
dpb
il 5 Lug 2022
Modificato: dpb
il 5 Lug 2022
Standard C does not include what is generically called a "lambda" outside MATLAB.
GCC has an extension but I've never used it.
The generic thing is to write and include a named function in place of the anonymous function.
8 Commenti
Steven Lord
il 5 Lug 2022
I haven't worked very much or at all with Simulink Compiler and S-functions but I believe the answer to your question is yes, assuming that all the MATLAB functions you're using in your S-function support C/C++ Code Generation and you're not violating any of the limitations for those functions in that mode.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!