기본 콘텐츠로 건너뛰기

라벨이 matlab인 게시물 표시

[MATLAB]Polynomial curve fitting - polyfit

polyfit - Polynomial curve fitting Syntax p = polyfit(x,y,n) [p,S] = polyfit(x,y,n) [p,S,mu] = polyfit(x,y,n) Description p = polyfit(x,y,n) finds the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i)) to y(i) , in a least squares sense. The result p is a row vector of length n+1 containing the polynomial coefficients in descending powers: [p,S] = polyfit(x,y,n) returns the polynomial coefficients p and a structure S for use with polyval to obtain error estimates or predictions. Structure S contains fields R , df , and normr , for the triangular factor from a QR decomposition of the Vandermonde matrix of x , the degrees of freedom, and the norm of the residuals, respectively. If the data y are random, an estimate of the covariance matrix of p is (Rinv*Rinv')*normr^2/df , where Rinv is the inverse of R . If the errors in the data y are independent normal with constant variance, polyval produces error bounds that contain at least 50...

[MATLAB]Circle Fit

  http://www.mathworks.com/matlabcentral/fileexchange/5557-circle-fit

Jacobain Matrix

robotics_jacobian_matrix.pdf [code cpp] (* * Example 3.9:  Jacobian for the Stanford arm * * RMM, 4 Nov 93 * *) <<RobotLinks.m (* twist axes for SCARA robot, reference frame at base *) xi1 = RevoluteTwist[{0,0,0}, {0,0,1}]; (* base *) xi2 = RevoluteTwist[{0,0,l0}, {-1,0,0}]; xi3 = PrismaticTwist[{0,0,l0}, {0,1,0}]; (* shoulder *) xi4 = RevoluteTwist[{0,l1,l0}, {0,0,1}]; (* wrist *) xi5 = RevoluteTwist[{0,l1,l0}, {-1,0,0}]; xi6 = RevoluteTwist[{0,l1,l0}, {0,1,0}]; gst0 = RPToHomogeneous[IdentityMatrix[3], {0,l1,0}]; (* Forward Kinematics (not really needed) *) gst = Simplify[   TwistExp[xi1,th1] . TwistExp[xi2,th2] .   TwistExp[xi3,th3] . TwistExp[xi4,th4] .   TwistExp[xi5,th5] . TwistExp[xi6,th6] . g0 ]; (* * Calculate the Jacobian "by inspection" * *) (* First joint (not very exciting) *) w1 = {0,0,1}; q1 = {0,0,l0}; xi1 = Join[-Skew[w1] . q1, w1] (* Second joint *) w2 = {-1,0,0}; w2p = SkewExp[w1,th1] . w2; xi2p = Join[-Skew[w2p] . q1, w2p] (* Third (prism...

Line-Line Intersection

Geometry  > Line Geometry  > Lines  > Geometry  > Line Geometry  > Concurrence  > MathWorld Contributors  > Pegg  > Interactive Entries  > Interactive Demonstrations  > Line-Line Intersection The intersection of two lines and in two dimensions with, containing the points and , and containing the points and , is given by (1) (2) where denotes a determinant . This corresponds to simultaneously solving (3) (4) for and . Other treatments are given by Antonio (1992) and Hill (1994). The intersections of two lines given in trilinear coordinates as (5) (6) is (7) Pseudocode for segment intersection is given by de Berg et al. (2000). Three lines in trilinear coordinates (8) (9) (10) concur if their trilinear coo...