QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 1665|回复: 11
打印 上一主题 下一主题

求助

[复制链接]
字体大小: 正常 放大

2

主题

12

听众

76

积分

升级  74.74%

  • TA的每日心情

    2016-1-28 15:03
  • 签到天数: 28 天

    [LV.4]偶尔看看III

    社区QQ达人

    跳转到指定楼层
    1#
    发表于 2016-1-23 20:52 |只看该作者 |倒序浏览
    |招呼Ta 关注Ta
    matlab里没有自带distanse函数,有没有哪个大神能帮忙写一个,万分感谢啊

    zan
    转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
    冉维        

    0

    主题

    12

    听众

    19

    积分

    升级  14.74%

  • TA的每日心情
    开心
    2016-1-23 22:14
  • 签到天数: 2 天

    [LV.1]初来乍到

    邮箱绑定达人

    回复

    使用道具 举报

    madio        

    3万

    主题

    1311

    听众

    5万

    积分

  • TA的每日心情
    奋斗
    2024-7-1 22:21
  • 签到天数: 2014 天

    [LV.Master]伴坛终老

    自我介绍
    数学中国站长

    社区QQ达人 邮箱绑定达人 优秀斑竹奖 发帖功臣 风雨历程奖 新人进步奖 最具活力勋章

    群组数学建模培训课堂1

    群组数学中国美赛辅助报名

    群组Matlab讨论组

    群组2013认证赛A题讨论群组

    群组2013认证赛C题讨论群组

    莫非是要定义一个距离函数吗?欧式距离?

    点评

    孤狼1512  问题解决,自己找了一个  详情 回复 发表于 2016-1-24 23:00
    回复

    使用道具 举报

    14

    主题

    10

    听众

    1262

    积分

    升级  26.2%

  • TA的每日心情
    开心
    2017-11-9 21:17
  • 签到天数: 198 天

    [LV.7]常住居民III

    网络挑战赛参赛者

    邮箱绑定达人

    群组大学生软件交流群

    群组2016国赛备战群组

    distance  Distance between points on sphere or ellipsoid

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2) computes the lengths,
        ARCLEN, of the great circle arcs connecting pairs of points on the
        surface of a sphere. In each case, the shorter (minor) arc is assumed.
        The function can also compute the azimuths, AZ, of the second point in
        each pair with respect to the first (that is, the angle at which the
        arc crosses the meridian containing the first point).  The input
        latitudes and longitudes, LAT1, LON1, LAT2, LON2, can be scalars or
        arrays of equal size and must be expressed in degrees. ARCLEN is
        expressed in degrees of arc and will have the same size as the input
        arrays.  AZ is measured clockwise from north, in units of degrees.
        When given a combination of scalar and array inputs, the scalar inputs
        are automatically expanded to match the size of the arrays.

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2,ELLIPSOID) computes
        geodesic arc length and azimuth assuming that the points lie on the
        reference ellipsoid defined by the input ELLIPSOID.  ELLIPSOID is a
        reference ellipsoid (oblate spheroid) object, a reference sphere
        object, or a vector of the form [semimajor_axis, eccentricity].  The
        output, ARCLEN, is expressed in the same length units as the semimajor
        axis of the ellipsoid.

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2,UNITS) uses the input
        string UNITS to define the angle unit of the outputs ARCLEN and AZ and
        the input latitude-longitude coordinates.  UNITS may equal 'degrees'
        (the default value) or 'radians'.

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2,ELLIPSOID,UNITS) uses the
        UNITS string to specify the units of the latitude-longitude
        coordinates, but the output range has the same units as the
        semimajor axis of the ellipsoid.

        [ARCLEN, AZ] = distance(TRACK,...) uses the input string TRACK to
        specify either a great circle/geodesic or a rhumb line arc. If TRACK
        equals 'gc' (the default value), then great circle distances are
        computed on a sphere and geodesic distances are computed on an
        ellipsoid. If TRACK equals 'rh', then rhumb line distances are computed
        on either a sphere or ellipsoid.

        [ARCLEN, AZ] = distance(PT1,PT2) accepts N-by-2 coordinate arrays
        PT1 and PT2 such that PT1 = [LAT1 LON1] and PT2 = [LAT2 LON2] where
        LAT1, LON1, LAT2, and LON2 are column vectors.  It is equivalent to
        ARCLEN = distance(PT1(:,1),PT1(:,2),PT2(:,1),PT2(:,2)).

        [ARCLEN, AZ] = distance(PT1,PT2,ELLIPSOID)
        [ARCLEN, AZ] = distance(PT1,PT2,UNITS),
        [ARCLEN, AZ] = distance(PT1,PT2,ELLIPSOID,UNITS) and
        [ARCLEN, AZ] = distance(TRACK,PT1,...) are all valid calling forms.

        Remark on Computing Azimuths
        ----------------------------
        Note that when both distance and azimuth are required for the same
        point pair(s), it's more efficient to compute both with a single
        call to distance.  That is, use:

            [ARCLEN, AZ] = distance(...);

        rather than its slower equivalent:

            ARCLEN = distance(...);
            AZ = AZIMUTH(...);

        Remark on Output Units
        ----------------------
        To express the output ARCLEN as an arc length expressed in either
        degrees or radians, omit the ELLIPSOID argument.  This is possible only
        on a sphere.  If ELLIPSOID is supplied, ARCLEN is expressed in the same
        length units as the semimajor axis of the ellipsoid.  Specify ELLIPSOID
        as [R 0] to compute ARCLEN as a distance on a sphere of radius R, with
        ARCLEN having the same units as R.

        Remark on Eccentricity
        ----------------------
        Geodesic distances on an ellipsoid are valid only for small
        eccentricities typical of the Earth (e.g., 0.08 or less).

        Remark on Long Geodesics
        ------------------------
        Distance calculations for geodesics degrade slowly with increasing
        distance and may break down for points that are nearly antipodal,
        and/or when both points are very close to the Equator.  In addition,
        for calculations on an ellipsoid, there is a small but finite input
        space, consisting of pairs in which both the points are nearly
        antipodal AND both points fall close to (but not precisely on) the
        Equator. In this case, a warning is issued and both ARCLEN and AZ
        are set to NaN for the "problem pairs."
       
        See also azimuth, reckon.

        Reference page in Help browser
           doc distance

    回复

    使用道具 举报

    14

    主题

    10

    听众

    1262

    积分

    升级  26.2%

  • TA的每日心情
    开心
    2017-11-9 21:17
  • 签到天数: 198 天

    [LV.7]常住居民III

    网络挑战赛参赛者

    邮箱绑定达人

    群组大学生软件交流群

    群组2016国赛备战群组

    回复

    使用道具 举报

    14

    主题

    10

    听众

    1262

    积分

    升级  26.2%

  • TA的每日心情
    开心
    2017-11-9 21:17
  • 签到天数: 198 天

    [LV.7]常住居民III

    网络挑战赛参赛者

    邮箱绑定达人

    群组大学生软件交流群

    群组2016国赛备战群组

    distance  Distance between points on sphere or ellipsoid

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2) computes the lengths,
        ARCLEN, of the great circle arcs connecting pairs of points on the
        surface of a sphere. In each case, the shorter (minor) arc is assumed.
        The function can also compute the azimuths, AZ, of the second point in
        each pair with respect to the first (that is, the angle at which the
        arc crosses the meridian containing the first point).  The input
        latitudes and longitudes, LAT1, LON1, LAT2, LON2, can be scalars or
        arrays of equal size and must be expressed in degrees. ARCLEN is
        expressed in degrees of arc and will have the same size as the input
        arrays.  AZ is measured clockwise from north, in units of degrees.
        When given a combination of scalar and array inputs, the scalar inputs
        are automatically expanded to match the size of the arrays.

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2,ELLIPSOID) computes
        geodesic arc length and azimuth assuming that the points lie on the
        reference ellipsoid defined by the input ELLIPSOID.  ELLIPSOID is a
        reference ellipsoid (oblate spheroid) object, a reference sphere
        object, or a vector of the form [semimajor_axis, eccentricity].  The
        output, ARCLEN, is expressed in the same length units as the semimajor
        axis of the ellipsoid.

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2,UNITS) uses the input
        string UNITS to define the angle unit of the outputs ARCLEN and AZ and
        the input latitude-longitude coordinates.  UNITS may equal 'degrees'
        (the default value) or 'radians'.

        [ARCLEN, AZ] = distance(LAT1,LON1,LAT2,LON2,ELLIPSOID,UNITS) uses the
        UNITS string to specify the units of the latitude-longitude
        coordinates, but the output range has the same units as the
        semimajor axis of the ellipsoid.

        [ARCLEN, AZ] = distance(TRACK,...) uses the input string TRACK to
        specify either a great circle/geodesic or a rhumb line arc. If TRACK
        equals 'gc' (the default value), then great circle distances are
        computed on a sphere and geodesic distances are computed on an
        ellipsoid. If TRACK equals 'rh', then rhumb line distances are computed
        on either a sphere or ellipsoid.

        [ARCLEN, AZ] = distance(PT1,PT2) accepts N-by-2 coordinate arrays
        PT1 and PT2 such that PT1 = [LAT1 LON1] and PT2 = [LAT2 LON2] where
        LAT1, LON1, LAT2, and LON2 are column vectors.  It is equivalent to
        ARCLEN = distance(PT1(:,1),PT1(:,2),PT2(:,1),PT2(:,2)).

        [ARCLEN, AZ] = distance(PT1,PT2,ELLIPSOID)
        [ARCLEN, AZ] = distance(PT1,PT2,UNITS),
        [ARCLEN, AZ] = distance(PT1,PT2,ELLIPSOID,UNITS) and
        [ARCLEN, AZ] = distance(TRACK,PT1,...) are all valid calling forms.

        Remark on Computing Azimuths
        ----------------------------
        Note that when both distance and azimuth are required for the same
        point pair(s), it's more efficient to compute both with a single
        call to distance.  That is, use:

            [ARCLEN, AZ] = distance(...);

        rather than its slower equivalent:

            ARCLEN = distance(...);
            AZ = AZIMUTH(...);

        Remark on Output Units
        ----------------------
        To express the output ARCLEN as an arc length expressed in either
        degrees or radians, omit the ELLIPSOID argument.  This is possible only
        on a sphere.  If ELLIPSOID is supplied, ARCLEN is expressed in the same
        length units as the semimajor axis of the ellipsoid.  Specify ELLIPSOID
        as [R 0] to compute ARCLEN as a distance on a sphere of radius R, with
        ARCLEN having the same units as R.

        Remark on Eccentricity
        ----------------------
        Geodesic distances on an ellipsoid are valid only for small
        eccentricities typical of the Earth (e.g., 0.08 or less).

        Remark on Long Geodesics
        ------------------------
        Distance calculations for geodesics degrade slowly with increasing
        distance and may break down for points that are nearly antipodal,
        and/or when both points are very close to the Equator.  In addition,
        for calculations on an ellipsoid, there is a small but finite input
        space, consisting of pairs in which both the points are nearly
        antipodal AND both points fall close to (but not precisely on) the
        Equator. In this case, a warning is issued and both ARCLEN and AZ
        are set to NaN for the "problem pairs."
       
        See also azimuth, reckon.

        Reference page in Help browser
           doc distance

    回复

    使用道具 举报

    14

    主题

    10

    听众

    1262

    积分

    升级  26.2%

  • TA的每日心情
    开心
    2017-11-9 21:17
  • 签到天数: 198 天

    [LV.7]常住居民III

    网络挑战赛参赛者

    邮箱绑定达人

    群组大学生软件交流群

    群组2016国赛备战群组

    可以的,值得看看

    点评

    孤狼1512  问题解决了,自己找了个合适的源程序  详情 回复 发表于 2016-1-24 23:01
    回复

    使用道具 举报

    14

    主题

    10

    听众

    1262

    积分

    升级  26.2%

  • TA的每日心情
    开心
    2017-11-9 21:17
  • 签到天数: 198 天

    [LV.7]常住居民III

    网络挑战赛参赛者

    邮箱绑定达人

    群组大学生软件交流群

    群组2016国赛备战群组

    回复

    使用道具 举报

    2

    主题

    12

    听众

    76

    积分

    升级  74.74%

  • TA的每日心情

    2016-1-28 15:03
  • 签到天数: 28 天

    [LV.4]偶尔看看III

    社区QQ达人

    madio 发表于 2016-1-24 16:12
    莫非是要定义一个距离函数吗?欧式距离?

    问题解决,自己找了一个
    回复

    使用道具 举报

    2

    主题

    12

    听众

    76

    积分

    升级  74.74%

  • TA的每日心情

    2016-1-28 15:03
  • 签到天数: 28 天

    [LV.4]偶尔看看III

    社区QQ达人

    远行的小船儿666 发表于 2016-1-24 20:36
    可以的,值得看看

    问题解决了,自己找了个合适的源程序
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2025-9-21 00:55 , Processed in 1.845164 second(s), 99 queries .

    回顶部