Slope of a line
Ältere Kommentare anzeigen
I'm trying to find the slope of this line
line([newBoxPolygon(1, 1) newBoxPolygon(4, 1)],[newBoxPolygon(1, 2) newBoxPolygon(4, 2)],'Color','G');
%Slope
X = (max([50 50])-min([50 50]));
Y=(max([1 10000])-min([1 10000]));
Slope_Reference=Y/X;
disp('Slope_Reference:');disp(Slope_Reference);
Is the slope i'm obtaining correct ?
Akzeptierte Antwort
Weitere Antworten (1)
Paul
am 16 Feb. 2014
(max([50 50])-min([50 50]))
returns 0, since the minimum and maximum of the vector [50 50] is 50. This means that X=0 and thus Y/X = Y/0 = inf.
Kategorien
Mehr zu PHY Components finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!