how to calculate the area under a plot? when I use the area option, I'm not getting a satisfactory value. someone pls help me.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
the program is attatched herewith clear all; clc; t=0:0.1:2.4; %total no. of points f=1./t fs=10; %sampling frequency y=xlsread('f1 15 th new.xlsx','sheet1','L6:L29'); %original function in time Y=fft(y); %convert to Freq domain plot(f,abs(Y),'r'); a=area(f,2*abs(Y)); a
0 Kommentare
Antworten (1)
Matt Kindig
am 8 Mai 2013
This isn't what the area() function does. The area function plots a filled shape below the line that is passed into it. The graphics handle to the shape is returned by the function, which is unrelated to the "area" of your curve.
Use trapz() instead.
doc trapz
0 Kommentare
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!