필터 지우기
필터 지우기

area of the shaded part above or under the baseline

조회 수: 2 (최근 30일)
mohamed gamal
mohamed gamal 2019년 5월 2일
편집: mohamed gamal 2019년 5월 2일
hello
i want a way so i can know the area of the shaded part above the base line and under it so i can multiple with the width of the road to get cut and fill informations
this my code till now
clc
clear
station = input('enter number of stations');
width = input('enter the width ');
compact = input('enter the compaction factor ');
x = 0:50:station*50;
y=1:station+1;
for i=1:station+1;
y(i) = input('Please input the elevation ');
end
Mean=mean(y);
[Offset, fv] = fzero(@(b) trapz(x, y-b), 0);
y_above = y - Offset;
y_below = max(-y_above,0); % Take the part below y_split
y_above = max(y_above,0); % Take the part above y_split
A_above = trapz(y_above);
A_below = trapz(y_below);
area(x,y,Offset);
grid on; set(gca,'layer','top');

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by