How to exclude Simulink blocks from code generation?

조회 수: 14 (최근 30일)
Omkar Bhanap
Omkar Bhanap 2018년 9월 30일
댓글: Robert Miklosovic 2024년 5월 10일
Basically, my project is: to acquire data from a USB webcam and perform some color thresholding and object tracking. The output obtained from these blocks is then given to Arduino for hardware implementation. Now if I directly build the model, it generates code for the whole model and then deploys to Arduino board which is basically consuming more memory and making my model to run at a slower speed.
How can exclude these blocks(computer vision and image processing toolbox) from code generation?
  댓글 수: 1
Robert Miklosovic
Robert Miklosovic 2024년 5월 10일
I can use the following statement to ignore code sections when using Matlab Coder, but it does not work with PLC coder.
if isempty(coder.target)
% Place code here you want to exclude from code generation
end
Is there a way to ignore code sections only during PLC code generation? Is there a way to detect in code that PLC Coder is operating on the code?

댓글을 달려면 로그인하십시오.

답변 (1개)

TAB
TAB 2018년 10월 1일

If you want to exclude some blocks from Simulion and Code Generation, then you can comment them out.

As far I know, there is no way to exclude some block only from code generation.

  댓글 수: 1
Omkar Bhanap
Omkar Bhanap 2018년 10월 1일
I don't want to exclude these blocks from Simulation. Just want to simulate the model without generating any code for these blocks.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by