clearvars function in simulink function block
Show older comments
The function in a simulink function block calls another function which has an instruction given below:
clearvars -global Downsample DATAPADDING_MSECS SEARCHBUFFER Fs WHOLE_SIGNAL Align_Nfft Window
This function is giving an error:
Function 'clearvars' not supported for code generation.
I have used
coder.extrinsic("clearvars");
But the error persists, what should I do?
Accepted Answer
More Answers (1)
Walter Roberson
on 10 Sep 2024
1 vote
Compiled models use static allocation for global variables. Asking to clear the global would be asking to release the static memory. This is unlikely to make the memory available for use, as the allocations for dynamic memory would be a different part of the address space.
1 Comment
Sania Gul
on 10 Sep 2024
Categories
Find more on Simulink Environment Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!