Azzera filtri
Azzera filtri

area of the shaded part above or under the baseline

2 visualizzazioni (ultimi 30 giorni)
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');

Risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti


Release

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by