SAFE a MATLAB to C translator

SAFE is a source-to-source compiler that translates MATLAB code to equivalent C code.
213 Downloads
Updated 25 Feb 2015

View License

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
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Code Generation, GPU, and Third-Party Support in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0