Using C libraries (FFT) in a s-function simulink
Show older comments
Hello,
I was trying to find the info but couldnt so thats why I am asking here. I hope is not repeated a hundred times.
I am not a huge expert in C programming, but I want to implement in an s-function the possibility to perform the fft. I have downloaded a library (FFTW3) and usually with different compilers I just need to install the library and the include the header file.
The question is, does it work the same way with the matlab compiler? how do I install the library so I can work with matlab? Actually a code that I am using includes the math.h library but I don't know how that library was installed.
I hope I made my point clear. Thank you very much!
1 Comment
PEDRO HENRIQUE Ulhoa
on 6 Jan 2021
Were you able to solve this problem?
Answers (1)
José-Luis
on 14 Oct 2012
0 votes
Two options come to mind, either use a mexfile, that allows you to call C/C++ and Fortran routines from Matlab. A mex-file needs to be compiled (from Matlab), with all related bells and whistles, such as the linking of your library.
2 Comments
Jose A. de Dios
on 14 Oct 2012
José-Luis
on 14 Oct 2012
It's no different than linking libraries in C/C++. If you are going to use mex files, then pass -I -L options to the compiler linking pointing to wherever you library is. Have a look at the mex documentation
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!