Filter löschen
Filter löschen

area of the shaded part above or under the baseline

2 Ansichten (letzte 30 Tage)
mohamed gamal
mohamed gamal am 2 Mai 2019
Bearbeitet: mohamed gamal am 2 Mai 2019
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');

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by