matlab中pdist函数,pdist用法

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

我有一个57600行2列的矩阵,想用pdist函数求此矩阵任意两个行向量的距离,可是运行时出现了这样的错误:

---------------------------------------------------------------------

Segmentation violation detected at Thu Dec 24 16:50:50 2015

------------------------------------------------------------------------

Configuration:

MATLAB Version: 7.0.0.19920 (R14)

Operating System: Microsoft Windows 2000

Window System: Version 5.0 (Build 2195)

Processor ID: x86 Family 6 Model 12 Stepping 3, GenuineIntel

Virtual Machine: Java 1.4.2 with Sun Microsystems Inc. Java HotSpot(TM) Client VM

(mixed mode)

Default Charset: ibm-1386_P100-2002

Can't dump stack

This error was detected while a MEX-file was running. If the MEX-file

is not an official MathWorks function, please examine its source code

for errors. Please consult the External Interfaces Guide for information

on debugging MEX-files.

If it is an official MathWorks function, please

follow these steps in reporting this problem to The MathWorks so

that we have the best chance of correcting it:

1. Send this crash report to segv@mathworks.com for automated analysis.

For your convenience, this information has been recorded in:

C:\Users\dell1\AppData\Local\Temp\matlab_crash_dump.2808

2. Also, if the problem is reproducible, send the crash report to

support@mathworks.com along with:

- A specific list of steps that will reproduce the problem

- Any M, MEX, MDL or other files required to reproduce the problem

- Any error messages displayed to the command window

A technical support engineer will contact you with further information.

Thank you for your assistance. Please save your workspace and restart

MATLAB before continuing your work.

Error in ==> pdist at 186

Y = pdistmex(X',dist,additionalArg);

有什么解决办法吗?请大神赐教,小女子跪拜!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Matlab,pdist函数用于计算矩阵X各对行向量的相互距离。具体而言,给定一个m行n列的矩阵X,pdist函数会生成一个长为m(m-1)/2的行向量D,其D的每个元素表示X对应行向量之间的距离。生成D的过程如下:首先,计算X的距离方阵,然后取方阵的下三角元素,并按照Matlab矩阵的按列存储原则排列这些元素的索引。可以使用squareform函数将D转换为原距离方阵。squareform函数是用来进行这种转换的,它的逆变换也是squareform函数。\[1\] 对于给定的m行n列矩阵X,其被视为m个行向量x1,x2,...,xm,pdist函数定义了向量xs和xt之间的各种距离如下:\[2\] 标准欧氏距离是一种常用的距离度量方法,它可以有效地解决欧氏距离的一些缺点。标准欧氏距离的计算公式如下:d2s,t = (xs - xt)V^(-1)(xs - xt)',其V是一个n行n列的对角矩阵,其第j个对角元素是S(j)^2,其S是标准差向量。需要注意的是,在许多Matlab函数,可以自定义V的值,不一定非得使用标准差,可以根据变量的重要程度设置不同的值,例如knnsearch函数的Scale属性。\[3\] #### 引用[.reference_title] - *1* *2* *3* [Matlab pdist 函数详解(各种距离的生成)](https://blog.csdn.net/ww2011/article/details/121022149)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值