Translating matlab functions to c- functions.

1 visualizzazione (ultimi 30 giorni)
Misha Dabaghyan
Misha Dabaghyan il 17 Ago 2015
Risposto: Walter Roberson il 17 Ago 2015
Hi, I have a matlab code code that analyzes and conditions some signals in a certain way (filters, etc). I would like to translate the whole procedure into C, to be later compiled into dll's that would be used by a bigger suite of programs. The flow of the program is e.g. "1) take the signal, apply a filter, add/subtract something to/from the result of the filter, down-sample, pass it down to the differentiation filter etc ...". I was wondering if each of these steps can be turned into separate C-code with the appropriate input-output capabilities (so that I would be able to choose which filters to "plug in"), and if so, what the best strategy would be. Would using the Simulink coder be the best approach, or should I just go with converting the m-files? Thanks.

Risposte (1)

Walter Roberson
Walter Roberson il 17 Ago 2015
Simulink Coder would be appropriate if your data was represented as a Simulink model. If it is not then use MATLAB Coder.
Note: if I recall correctly, the filter design routines cannot be used with MATLAB Coder, but the filter that gets designed can be. Building a general interface that allowed the user to construct new filters would, I suspect, be considered an impermissible duplication of MATLAB functionality that would not be permitted to be compiled by the Terms and Conditions; this would not be an issue if the filter coefficients are already decided and you are applying the filters.

Categorie

Scopri di più su Embedded 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!

Translated by