How to find area under plotted curve if given a vector containing numerical data?
Mostra commenti meno recenti
If given the following data set, a, for example, and vector a is plotted using the code provided below, how do I find the area under that curve? I understand that one way would be to determine the function of the plotted curve and integrating it. I would also have to define where the x-axis is at zero, so probably at 1150 would be where I want the positive x-axis to begin.. But if I go that route, does MATLAB have a way of determining the function of a plotted curve? Or is there a MATLAB function that would help me do all that and output the area under the curve???
a = [840.827393
880.441772
982.080688
1222.500488
1549.706665
1773.614624
1845.284546
1815.412964
1723.675903
1604.484131
1470.431763
1356.473511
1268.526978
1167.364990
1095.291504
1039.703857
1012.517639
1018.414062
1052.356323
1079.090698];
figure
plot(1:length(a),a)
grid on
axis([-inf inf min(min(a)) max(max(a))])
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!