Area between two curves that plotted by importing datapoints

조회 수: 1 (최근 30일)
friet
friet 2020년 6월 20일
댓글: KSSV 2020년 6월 21일
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.
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
Walter Roberson
Walter Roberson 2020년 6월 21일
mask = -0.3 <= x & x <= 3.3;
trapz(t1(mask))

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by