matlab - matlab 三维绘图

标签 matlab 3d

我正在尝试做一个与所附的类似的图。

我正好有一个包含日期(x 轴)的 (224x1) 向量、一个包含到期日(y 轴)的 (10x1) 向量和一个包含值(z 轴)的 (224x10) 矩阵。

我尝试了 surf(X, Y, Z) 但出现错误(“数据维度必须一致”)。

我怎样才能将其结合起来制作一个像所附的那样的情节?

谢谢,V!

编辑:第二个情节是我使用路易斯·门多的建议得到的情节:

3d plot

enter image description here

最佳答案

使用

surf(Y,X,Z)

来自documentation (强调):

surf(x,y,Z) and surf(x,y,Z,C), with two vector arguments replacing the first two matrix arguments, must have length(x) = nand length(y) = m where [m,n] = size(Z). In this case, the vertices of the surface patches are the triples (x(j), y(i), Z(i,j)). Note that x corresponds to the columns of Z and y corresponds to the rows.

关于matlab - matlab 三维绘图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29903263/

相关文章:

google-maps - 在 Google map 中使用 3D

matlab - 选择一列中的值与特定向量匹配的行

opengl - 多头显示系统

matlab - 如何使用Matlab函数snr()获得准确的估计?

matlab - 如何计算矩阵的质心?

c# - 绘制立方体的无 Glu 示例?

opencv - 如何从单个图像获取相机变换矩阵?

c++ - 计算 3D 平面的斜率

python - 只是对 NumPy 函数的结果感到好奇!

matlab - 在 MATLAB 中从最小到最大对元胞数组的所有维度进行排序