码迷,mamicode.com
首页 > 移动开发 > 详细

approximate derivate with difference for a discrete data in matlab

时间:2019-08-26 23:12:18      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:crete   and   with   技术   inf   app   src   alt   The   

backgound: post processing of VIV

goal:  to get y‘ and y‘‘

 

input data:

技术图片

output:

y‘ vs time, and y‘‘ vs time

 

Matlab code

1 clc;
2 clear;
3 data=xlsread(gap1Ur8.xlsx);
4 t=data(1000:2000,1);  % time
5 dt= 0.005;
6 y=data(1000:2000,2);      % displacement, 2nd column in the input data
7 der_y=diff(y)./dt;            % y=dy/dt, i.e. 1st derivative
8 der_y_2 = diff(der_y)./dt;    % y‘‘, i.e. 2nd derivative of y
9 plot( data(1002:2000,1), der_y_2, k,data(1001:2000,1), der_y,r,t, y, b);

 

approximate derivate with difference for a discrete data in matlab

标签:crete   and   with   技术   inf   app   src   alt   The   

原文地址:https://www.cnblogs.com/code-saturne/p/11415231.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!