Matlab中2D矩阵的3D绘图 [英] 3d plotting of a 2d matrix in matlab

查看:127
本文介绍了Matlab中2D矩阵的3D绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MxN矩阵Z和一些变量h.该矩阵表示函数f(x,y)的解的点. h是点之间的间距.例如:

Z(x/h,y/h) = (some value in the Z direction), where x and y are some multiple of h

域从0到M * h,范围从0到N * h.我想对矩阵定义的解决方案进行3D表示.该图应类似于使用pdetool生成的图.如何在Matlab中做到这一点?

解决方案

您可以使用surfbar3.

以下是文档:

冲浪: http://www.mathworks.fr/help/matlab/ref/surf.html; jsessionid = c680a6b29a1fa8ff47c120353c12

bar3: http://www.mathworks.fr/fr/help/matlab/ref/bar3.html

I have an MxN matrix, Z, and some variable h. This matrix represents the points to a solution of a function f(x,y). h is the spacing between points. For instance:

Z(x/h,y/h) = (some value in the Z direction), where x and y are some multiple of h

The domain is from 0 to M*h and the range is from 0 to N*h. I would like to make a 3d representation of the solution defined by the matrix. The graph should be similar to what is produced using the pdetool. How do I do this in Matlab?

解决方案

You can use surf or bar3.

Here is the documentation:

surf: http://www.mathworks.fr/help/matlab/ref/surf.html;jsessionid=c680a6b29a1fa8ff47c120353c12

bar3: http://www.mathworks.fr/fr/help/matlab/ref/bar3.html

这篇关于Matlab中2D矩阵的3D绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆