c2d simulink

6 views (last 30 days)
M Brodecki
M Brodecki on 11 Mar 2012
Hello,
I'm trying to implement a EKF in simulink. The matlab counterpart of my filter uses the c2d command to obtain the discrete time equivalent matrices. This command, however, does not work in embedded matlab file. Is there a way around this?
Kind regrads, M

Accepted Answer

M Brodecki
M Brodecki on 3 Apr 2012
I already found the solution. You can use the c2d code itself in your embedded matlab file:
[m,n] = size(F); [m,nb] = size(G); s = expm([[F G]*Ts; zeros(nb,n+nb)]); Phi = s(1:n,1:n); Gamma = s(1:n,n+1:n+nb);
Alternatively an approximation can be used as presented in the paper below (page 23, equation 2.85).
ode45 can be replaced by coding your own Runge-Kutta solver in embedded matlab.

More Answers (1)

Abhishek Dutta
Abhishek Dutta on 3 Apr 2012
I have the same problem, whats the replacement for 1)c2d and 2)ode45 in embedded matlab?

Tags

Community Treasure Hunt

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

Start Hunting!