| 查看: 1497 | 回复: 3 | |||
[求助]
matlab surf函数的使用
|
|
y(i,j)是一个600*3600的矩阵,已经求解出来了,希望用surf函数,将i,j作为函数y的两个自变量表示成图形输出出来,求大神相助。 这是我写的语句: [i,j]=meshgrid(1:600,1:3600); for i=1:600 for j=1:3600 z(i,j)=y(i,j); end end surf(i,j,z) 但错误很多,运行matlab提示: ??? Error using ==> surf at 78 Data dimensions must agree. Error in ==> DEEuler at 73 surf(i,j,z) [ Last edited by lixixiao2 on 2012-10-17 at 10:36 ] |
» 猜你喜欢
论文终于录用啦!满足毕业条件了
已经有16人回复
求个博导看看
已经有19人回复
投稿Elsevier的杂志(返修),总是在选择OA和subscription界面被踢皮球
已经有8人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求matlab画一个函数的图
已经有6人回复
MATLAB函数速查手册
已经有211人回复
matlab surf函数
已经有3人回复
matlab的函数调用问题
已经有3人回复
问个关于matlab里find函数的问题!
已经有4人回复
求助:谁会用matlab画图?
已经有13人回复
matlab做函数图象的问题
已经有6人回复
navolo
木虫 (正式写手)
- 应助: 13 (小学生)
- 金币: 3878.3
- 散金: 5
- 红花: 18
- 帖子: 419
- 在线: 174小时
- 虫号: 1500304
- 注册: 2011-11-19
- 性别: GG
- 专业: 无机非金属类光电信息与功
【答案】应助回帖
|
你的矩阵维数不一致, 关于surf命令与mesh使用类似,你可以看下帮助help surf help surf SURF 3-D colored surface. SURF(X,Y,Z,C) plots the colored parametric surface defined by four matrix arguments. The view point is specified by VIEW. The axis labels are determined by the range of X, Y and Z, or by the current setting of AXIS. The color scaling is determined by the range of C, or by the current setting of CAXIS. The scaled color values are used as indices into the current COLORMAP. The shading model is set by SHADING. SURF(X,Y,Z) uses C = Z, so color is proportional to surface height. SURF(x,y,Z) and SURF(x,y,Z,C), with two vector arguments replacing the first two matrix arguments, must have length(x) = n and 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. SURF(Z) and SURF(Z,C) use x = 1:n and y = 1:m. In this case, the height, Z, is a single-valued function, defined over a geometrically rectangular grid. SURF(...,'PropertyName',PropertyValue,...) sets the value of the specified surface property. Multiple property values can be set with a single statement. SURF(AX,...) plots into AX instead of GCA. SURF returns a handle to a surface plot object. AXIS, CAXIS, COLORMAP, HOLD, SHADING and VIEW set figure, axes, and surface properties which affect the display of the surface. Backwards compatibility SURF('v6',...) creates a surface object instead of a surface plot object for compatibility with MATLAB 6.5 and earlier. See also surfc, surfl, mesh, shading. Overloaded functions or methods (ones with the same name in other directories) help sweepset/surf.m Reference page in Help browser doc surf |
2楼2012-10-30 22:07:50
wurongjun
专家顾问 (职业作家)
-

专家经验: +831 - 数学EPI: 9
- 应助: 791 (博后)
- 贵宾: 0.308
- 金币: 24609
- 散金: 310
- 红花: 75
- 帖子: 3004
- 在线: 881.2小时
- 虫号: 1368482
- 注册: 2011-08-14
- 性别: GG
- 专业: 计算数学与科学工程计算
- 管辖: 数学

3楼2012-10-30 22:25:41
4楼2012-11-04 11:45:55







回复此楼