MATLAB Answers

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

조회 수: 1(최근 30일)
Joshua Ford
Joshua Ford 2021년 7월 22일
답변: Darshan Ramakant Bhat 2021년 7월 23일
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.

답변(1개)

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2021년 7월 23일
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!

Translated by