No BSD License  

Highlights from
Examples of incorporating m-code into Simulink models

Examples of incorporating m-code into Simulink models

by

 

23 Sep 2004 (Updated )

Example Simulink models to support a MATLAB Digest article from September 2004.

aero_plot_mlfcn(txy)
function aero_plot_mlfcn(txy)

t = txy(1);
x = txy(2:3);
y = txy(4:5);

doPlot(t,x,y)

function doPlot(t,x,y)
% This block supports an embeddable subset of the MATLAB language.
% See the help menu for details. 

if t == 0
    hold('off'); clf;
    %axis([-50000 50000 -50000 50000]); hold('on')
    %plot([-50000 50000],[0 0])
    %plot([0 0],[-50000 50000])
    axis([-10000 30000 -10000 80000]); hold('on')
    plot([-10000 30000],[0 0])
    plot([0 0],[-10000 80000])
    title('\bf{Kalman Filter Using Embedded MATLAB}')
    text(-40000,-25000,'\rm\it{Position Measurements (Blue) & Position Estimates (Red)}')
    grid('on')
   
end
plot(x(1),y(1),'Marker','+','MarkerSize',3)
plot(x(2),y(2),'Marker','*','Color',[1 0 0],'MarkerSize',3)

Contact us