SAFE a MATLAB to C translator
SAFE is a source-to-source compiler that translates MATLAB code to equivalent C code.
It targets DSP and image processing applications with fixed and variable sized data.
The main features of the output C code include dynamic memory allocation for array
data in the output C code and exception functions that capture faulty runtime conditions such as array
size mismatch in algebric array and indexing expressions. This post illustrates the
application of SAFE compiler on an image processing medical application that includes
lowpass filtering, edge detection, and the negative of an image algorithms. The files
included consist of the initial algorithm specification in MATLAB and the equivalent
output code in C.
The MATLAB specification file is separated in two parts: a) The
declaration section where array variables are declared along with their worst case
size and b) The MATLAB code specification part. The derived C specification comprises
of three files: a) SC2C.c is the main file derived from the translation of the MATLAB
code, b) SCTypedef.h is a header file having declarations of data types and functions
required to support the execution and c) SCTypedef.c is the supporting implementation
file of the supporting data types and functions.
Cite As
Grigorios Dimitroulakos (2024). SAFE a MATLAB to C translator (https://www.mathworks.com/matlabcentral/fileexchange/49827-safe-a-matlab-to-c-translator), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Computer Vision Toolbox > Code Generation, GPU, and Third-Party Support >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |