matlab coding to s-function level 2 coding.
이전 댓글 표시
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.
댓글 수: 2
Kaustubha Govind
2012년 1월 31일
It depends on what xhat and P stand for in your filter.
dab483
2012년 1월 31일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Configure Block Features for MATLAB S-Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!