필터 지우기
필터 지우기

How to integrate two columns of data in MAT LAB

조회 수: 3 (최근 30일)
Sathyamoorti
Sathyamoorti 2013년 10월 17일
댓글: Sathyamoorti 2013년 10월 18일
I have two columns of data in excel and I want to double integrate it in MATLAB using Trapezoidal method. Can some one help me how to do it in MATLAB R2009b. Any help is highly appreciated.

답변 (1개)

Wayne King
Wayne King 2013년 10월 17일
Since you are on an older release, how about using dblquad() instead?
  댓글 수: 3
Jan
Jan 2013년 10월 17일
Please explain, what you have tried so far, e.g. if the import from Excel is working already, or if this is a part of the question. Please consider Where to add more details.
Sathyamoorti
Sathyamoorti 2013년 10월 18일
This is the code which I have tried so far all going futile
function dispdata = wint(w,dt)
N1=length(w);
numbers = w(1:1001);
N = 2^nextpow2(N1);
if N > N1
w(N1+1:N) = 0;
end
df = 1 / (N*dt);
Nyq = 1 / (2*dt);
acc_freq_data = fftshift(fft(w));
disp_freq_data = zeros(size(acc_freq_data));
f = -Nyq:df:Nyq-df;
for i = 1 : N
if f(i) ~= 0
disp_freq_data(i) = acc_freq_data(i)/(2*pi*f(i)*sqrt(-1))^2;
else
disp_freq_data(i) = 0;
end
end
dispdata = ifft(ifftshift(disp_freq_data));
dispdata = dispdata(1:N1);
w = xlsread('rawdata1.xlsx'); dt=.02; t=[0:dt:20]; acc = trapz (w,N1); disp = wint(acc,dt); plot(t,disp,t,acc);

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by