필터 지우기
필터 지우기

Can we generate macro function in code, using simulink model and RTW EC auto coder ?

조회 수: 3 (최근 30일)
We are currently having lot of for loops , and they are just to fetch the data from a constant array in to a local data array We need to optimze that .
Is there any way in Matlab modelling ,
Can we generate a Macro code , instead of regular C code ,using the library block sets in simulink and RTW-EC Auto code generator ?
that will increase the memory consumption , but my execution can be improved !!

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 5월 3일
The closest thing that I can think of is to increase the Loop unrolling threshold on the Configuration Parameter window's Optimization Pane, so the indexing code is inlined, instead of using for-loops. I'm not sure if this is what you intend when you say "macro code".
  댓글 수: 1
Ajay Pherwani
Ajay Pherwani 2013년 5월 5일
Thanks for the answer .
1) using "Optimization Pane" will be helpful if i had an fixed size array But we are rolling this for loop over the size of array ( which can vary )
hence my code cannot have to be a fixed inline assignment .
2)Yes when I say "Macro code" its something like " #define " in C coding
At the time of compilation( hex file generation - that we put in our controller) these particular part of codes are optimized( Inlined ) by compiler
--> This will be helpful in the case of varying size of array .. that inlining which we are think of achieveing in matlab code gen , will be take care during the compilation process .
Let me know your thoughts

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

Community Treasure Hunt

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

Start Hunting!

Translated by