Interpolation and Intergration using Matlab

조회 수: 9 (최근 30일)
kayne
kayne 2013년 7월 23일
Hi,
I have been trying to use the Interpolation function in Matlab but not sure if what I am doing is correct.
I have gathered data from an experiment and wanted to get a smoother graph so that I can get an accurate output.
The data that I have is
Volts = 237;
Amps = [7:0.025:10.6];
time = [0:1:144];
yi = interp1(Amps,time,'spline');
figure(2)
plot(yi)
Power = Volts.*yi;
From the graph that Matlab output it I have time on the X axis and Current on the Y axis.
I then multiplied this by the voltage to give me the power corrosponding at the different point and now would like to know the total area under the curve.
I would like to know how to do this using a step type intergration at one second intervals.
Any help on the code would be appreciated.
Thanks Kayne
  댓글 수: 3
Jan
Jan 2013년 7월 23일
Creating "smoother" graphs is not a scientifically correct method to show results of a measurement. Notice that a spline interpolation can increase the range of the values.
kayne
kayne 2013년 8월 22일
trapz(y) is the function that I needed, thanks for that

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by