how to design swap logic with simulink blocks ?

can any one tell me how to design below swap logic with simulink blocks, to get same code with embedded coder.
void Swap(int *p,int *q)
{
temp = *p;
*p = *q;
*q = temp;
}
is there any possibulity to get the code same like above with embedded coder?

Answers (1)

Take a look at the MATLAB Function block (https://www.mathworks.com/help/simulink/slref/matlabfunction.html)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Asked:

on 22 May 2019

Answered:

on 28 May 2019

Community Treasure Hunt

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

Start Hunting!