Clear Filters
Clear Filters

Is there an estimate/ratio of many lines of C code is produced by MATLAB? Is there an estimate of time too?

5 views (last 30 days)
I want to generate 10,000 lines of matlab code into c code. The matlab code contains many different signal processing techniques and functions. Is there an estimate I can use to figure out how many lines of C code will be produced and how long will it take (ignoring testing, requirements etc). We are ideally using embedded coder to generate the code, aiming at execution timing and accuracy.
Any references or documentation would be great thanks.

Answers (1)

Darshan Ramakant Bhat
Darshan Ramakant Bhat on 23 Jul 2021
The number of lines of code will vary depending on on the actual MATLAB function. Innoncent looking fft() can produce 100+ lines of C code :)
Please be aware that not all MATLAB functions are supported for C/C++ code generation. You can use coder.screener() to get a compatibility report :
Also below is the list of MATLAB functions supported for codegen as of latest release :
Hope this will be helpful.

Community Treasure Hunt

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

Start Hunting!