绘图问题 - 比较 3 个矩阵,其中一个是稀疏矩阵
我需要比较 3 216x216 矩阵(数据相关矩阵、事件等)。有人可以建议一种在 matlab 或其他绘图工具中绘制这些图的方法,这些工具可以轻松地可视化和比较它们...... 3d 网格图有用吗?我认为网格会很好..但我也需要其他人的意见。
提前致谢,
I need to compare 3 216x216 matrix (data correlation matrix, events etc) . can someone suggest a way to plot these in matlab or someother plotting tools that can easily visualise and compare them ... does a 3d mesh plot be useful ? I thought mesh would be good .. but I need others opinion too.
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
稀疏矩阵
您可以使用
spy()
方法可视化“稀疏模式”(Matlab 称之为)。它在矩阵元素非零的地方绘制一个点(或任何其他标记)。spy()
还可以用于可视化非稀疏矩阵,其中许多条目接近于零 - 只需首先对矩阵进行阈值处理:更一般地,您可以应用上限和下限阈值来可视化位置其值在特定范围内的矩阵条目。
相关
仅使用
imagesc()
显示矩阵可能会很有用。这可以让您了解数据中的相关程度 - 即,未相关的信号将具有具有主导对角线元素的相关矩阵,该矩阵将清晰可见。我发现 Matlab 的默认颜色图分散了我的注意力,所以我通常会做一些类似“杂项”
的事情。当然,您可以进行大量非视觉比较 - 各种
norm()
's、std( )
,使用eig()
对方阵进行频谱分析,或者更一般地使用svd()
。您可以比较特征值大小,或比较特征向量。这可能非常有用,也可能完全是垃圾,具体取决于您的数据是什么。因此,总而言之(目前),根据您的矩阵具体包含的内容,您可能会得到更有用的建议。
Sparse matrices
You can use the
spy()
method to visualize a "sparsity pattern", as Matlab calls it. It plots a dot (or any other marker) where the matrix element is non-zero.spy()
can also be used to visualize non-sparse matrices where a lot of entries are close to zero - just threshold the matrix first:More generally, you can apply upper and lower thresholds to visualize the location of matrix entries whose value is within a specific range.
Corellation
It may be useful to just display the matrix using
imagesc()
. This may give you an idea of the degree of corellation in your data - i.e. an uncorellated signal will have a corellation matrix with dominant diagonal elements, which will be clearly visible. I find Matlab's default color map distracting, so I usually do something likeMiscellaneous
Of course, there's a whole host of non-visual comparisons you can make - various
norm()
's,std()
, spectral analysis usingeig()
for square matrices, orsvd()
more generally. You can compare eigenvalue magnitudes, or compare the eigenvectors. This may be very useful or complete garbage, depending on what your data is.Thus, to conclude (for now), depending on what specifically your matrices contain, you may get more useful suggestions.