image thumbnail

Accurate Modeling in Simulink

by

 

03 Nov 2006 (Updated )

These files accompany the November 2006 article in MATLAB Digest

integration_is_a_filter.m
%%
t = linspace(0,6,301);
randn('state',0)
acc = 10*randn(size(t));

vel = cumtrapz(t,acc);

pos = cumtrapz(t,vel);

subplot(3,1,1)
plot(t,acc)
title('Acceleration')

subplot(3,1,2)
plot(t,vel)
title('Speed')

subplot(3,1,3)
plot(t,pos)
title('Position')

Contact us