给定X,Y和Z向量生成轮廓 [英] Generate Contour Given X, Y and Z vectors
问题描述
给出3个向量对X
,Y
和Z
,如何生成轮廓?我了解我们需要利用 contour
情节.但事实是,我们需要为此参数传递2x2矩阵,该矩阵大概是与每个X,Y对相对应的Z矩阵.但这意味着在谈论轮廓生成之前,我必须花更多的精力通过首先使用griddata
插值来创建这样的矩阵.
Given 3 vector-pair, X
, Y
and Z
, how to generate the contour? I understand that we need to make use of the contour
plot. But the thing is that we need to pass in a 2x2 matrix for this argument, which presumably, is a matrix of Z corresponding to each X,Y pair. But this would mean that I have to go extra miles to create such a matrix by using griddata
interpolation first before talking about contour generation.
还有其他更简洁的方法吗?
Is there any other more succinct method?
推荐答案
是.使用 Tricontour 工具.它可以在文件交换器上找到(在Matlab Central上).这可以根据您的需要直接进行轮廓处理,而不会强制您使用meshgrid和griddata.
Yes. Use the Tricontour tool. It is found on the file exchange (on Matlab Central.) This does the contouring as you desire directly, without forcing you to use meshgrid and griddata.
这篇关于给定X,Y和Z向量生成轮廓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!