Home Matlab plotting errors when trying to compute integral and double integral
Reply: 0

Matlab plotting errors when trying to compute integral and double integral

Trinny Tat
1#
Trinny Tat Published in 2018-02-13 03:11:58Z

My Code

M=dlmread('C:\Users\distanceY.data','\t');

xaccel=M(:,5);

time = 0:0.05:781.45;

figure

plot(time,xaccel)

title('Acceleration')

xlabel('Time')

Z=cumtrapz(time,xaccel);

figure

plot(time,Z)

title('Velocity')

xlabel('Time')

W=cumtrapz(time,Z);

figure

plot(time, W)

title('Distance')

xlabel('Time')

It gives me errors

Error using plot Vectors must be the same length.

Error in Graph2 (line 5) plot(time,xaccel)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306426 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO