How to check multiple values in an equation in MATLAB?

1 Ansicht (letzte 30 Tage)
Lily Ahlstrom
Lily Ahlstrom am 8 Sep. 2022
Beantwortet: David Hill am 8 Sep. 2022
To size a sedimentation basin for a water treatment process, the length:width ratio must be chosen based off of the given area and should be greater than 5:1. If A = 1390m^2 and the width values are considered in increments of 6m (6, 12, 18,...), how could you iterate through the equation L=A/w in MATLAB with every w value such that L is returned as the smallest calculated value greater than 5?

Antworten (1)

David Hill
David Hill am 8 Sep. 2022
L=1390./(6:6:1390);
Lmin=L(find(L>5,1,'last'))
Lmin = 5.0362

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by