Hi,
Using Matlab, i can initialize the particle filter like this:
for i = 1 : N xhatplus(:,i) = xhat + sqrt(P) * [randn; randn; randn];end
Now, i want to use simulink s-function level 2. how should i coding it?
function DoPostPropSetup(block) block.Dwork(3).Name = 'xhatplus'; block.Dwork(3).Dimensions = N*3; block.Dwork(3).DatatypeID = 0; block.Dwork(3).Complexity = 'Real'; block.Dwork(3).UsedAsDiscState = true;function InitializeConditions(block) block.Dwork(3).Data = ??
Any advise? Thanks.
Best Answer