How to determine if points fall above an arbitrary line?
Mostra commenti meno recenti
Hello all,
I am trying to find a way to determine if points are above or below an arbitrary line. For example, the code
numXY = randi([1, 19], 1);
lineXs = [0; sort(rand(numXY, 1) * numXY)];
lineYs = rand(size(lineXs));
Xs = rand([100, 1]) * max(lineXs);
Ys = rand(size(Xs));
figure
scatter(Xs, Ys, '.k')
hold on
plot(lineXs, lineYs, 'r')
axis tight
would produce something like

How to determine which of the points in (Xs, Ys) are above or below the red line defined by (lineXs, LineYs)?
Thank you in advance!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Share and Distribute Software in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
