Area between two curves that plotted by importing datapoints
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello
I have two curves imported from excel and ploted as shown in the figure below. How can I calculate the red area between the two curves. And also it is possible to assigned a color in the area.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/319708/image.jpeg)
clc
close all
clear all
a=xlsread('D:\Folder.xlsx','Sheet1','A1:A237');
b=xlsread('D:\Folder.xlsx','Sheet1','B1:B237');
x=linspace(80,250,237);
y = zeros(237,1);
y(:)=0.1465;
plot(x,y,a,b)
4 commentaires
Walter Roberson
le 21 Juin 2020
mask = -0.3 <= x & x <= 3.3;
trapz(t1(mask))
KSSV
le 21 Juin 2020
You canget the intersection points using this function:
Réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!