how to create variable size buffer in simulink (Embedded Matlab Function)?

2 views (last 30 days)
Following is the pseudo code i need to create..
function [output]=CircularBuffer(input,receive_status,send_status)
persistent buffer idx
if receive_status==1
buffer(idx,1)=input %%%input is variable sized array for e.g 1x368 or 1x460
idx=idx+1;
end
output=0
if send_status==1
output=buffer(1,:)
buffer=buffer(2:end,:)
idx=idx-1
end
%%I do not have signal processing toolbox so cannot use in-built library for queue

Answers (0)

Categories

Find more on MATLAB Coder 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!