Static analysis of .m files

조회 수: 5 (최근 30일)
Ashley Thorpe
Ashley Thorpe 2019년 11월 15일
답변: Jatin 2024년 9월 19일
I am used to working with static analysis tools which enforce the MISRA standard on c and c++ code.
But now we are creating a tool using matlab .m files, and I am trying to understand what static analysis checks we can set up.
I have already set up a unit test which performs the matlab checkcode (new mlint function) across all the source files to check for matlab code analyser issues and determine code complexity. This is good, but the matlab code analyser checks do not seem quite as stringent as the full MISRA checks
I have come across the Polyspace toolbox, but from initial research I assume this is only for analysing c/C++ generated code.
My question – is there any further static analysis that I can perform on the matlab .m source files to further check for and enforce the harshest MISRA rules?

답변 (1개)

Jatin
Jatin 2024년 9월 19일
Hi Ashley,
You're correct that there isn't a specific static analysis tool for MATLAB files, and your understanding is right that the product PolySpace Code Prover and Bug Finder are used to analyze C/C++ codes. You're on the right track by using the MATLAB Code Analyzer and writing unit tests with the MATLAB Unit Testing Framework to maintain high code quality and enforce rigorous coding standards.
Additionally, consider using the MATLAB Profiler which is used to analyze the performance of your MATLAB code. It helps identify bottlenecks, optimize code execution time and improve the code quality of MATLAB files.
For more information on profiler, you can refer to the documentation here:
I hope this helps address your query.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by