필터 지우기
필터 지우기

I don't want to use local variable in chart

조회 수: 1 (최근 30일)
TaeHee Kwun
TaeHee Kwun 2019년 5월 30일
댓글: TaeHee Kwun 2019년 6월 4일
Hi, I am Student in graduated school.
I have some problem about code generation of chart.
when I generate code condition, [AAA > (BBB>>1)]
It generate code like this.
Local_tmp = BBB >> 1;
if(AAA > Local_tmp) {...}
to conclude, I don't want to make local variable in code. So, Isn't there any to set variable's data type?

채택된 답변

Jonas
Jonas 2019년 6월 4일
You need to check your 'Configuration Parameters', under the section 'Code Generation' part 'Optimization'. For your requirements, I believe you will need to check:
  • Signal storage reuse
  • Eliminate superfluous variables (expression folding)
  • Enable local block outputs
  • Reuse global/local block outputs
Depending on what you require, you may want to try these settings some more.
ert.png
  댓글 수: 1
TaeHee Kwun
TaeHee Kwun 2019년 6월 4일
Thanks for your answer. Jonas :)
I tried that but it doesn't work to me.
I solve this problem by changing parameter that can tune to inline.
I think it's no way to put operation in the condition of if sentence.
But I still hope to do this for readability.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by