Get the Slope and Intercept of drawn Lines
by Jean-Luc Dellis
24 Mar 2009
(Updated 26 Mar 2009)
You have to draw a line in a graph to obtain the slope of a curve or of its tangent.
|
Watch this File
|
| File Information |
| Description |
SYNTAX:
[p1,p2,slope,inter]=getslopeintercept
OUTPUTS:
P1= coordinates of the first cliked point
P2= coordinates of the second cliked point
SLOPE= slope of the drawn line
INTER= intercept Y(X=0)
WHAT ?
In the current figure, you have to draw a line between 2
clicked points of a planar graph. The GETSLOPEINTERCEPT
function then displays the slope and the intercept of the
drawn line in a text box
EXAMPLE
plot([1:10],[1:10].^0.5,'-o')
getslopeintercept
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 26 Mar 2009 |
* fix the bug
* add an example in the help
* improve the capabilities, the function can now work on several plots
I apologize to all who downloaded the bad-coded function and thanks MATT who warms me. |
|
Contact us at files@mathworks.com