| 4 | 1/1 | 返回列表 |
| 查看: 1593 | 回復(fù): 3 | |||
lixixiao2銅蟲 (小有名氣)
|
[求助]
matlab surf函數(shù)的使用
|
|
y(i,j)是一個(gè)600*3600的矩陣,已經(jīng)求解出來了,希望用surf函數(shù),將i,j作為函數(shù)y的兩個(gè)自變量表示成圖形輸出出來,求大神相助。 這是我寫的語句: [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) 但錯(cuò)誤很多,運(yùn)行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 ] |
木蟲 (正式寫手)
|
你的矩陣維數(shù)不一致, 關(guān)于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 |
專家顧問 (職業(yè)作家)
![]() |
專家經(jīng)驗(yàn): +831 |

銀蟲 (小有名氣)
| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 291 求調(diào)劑 +3 | 化工2026屆畢業(yè)?/a> 2026-03-21 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 一志愿西安交通大學(xué)材料工程專業(yè) 282分求調(diào)劑 +10 | 楓橋ZL 2026-03-18 | 12/600 |
|
|
[考研] 0703化學(xué)297求調(diào)劑 +3 | Daisy☆ 2026-03-20 | 3/150 |
|
|
[考研] 302求調(diào)劑 +12 | 呼呼呼。。。。 2026-03-17 | 12/600 |
|
|
[考研] 22 350 本科985求調(diào)劑,求老登收留 +3 | 李軼男003 2026-03-20 | 3/150 |
|
|
[考研] 265求調(diào)劑 +3 | Jack?k?y 2026-03-17 | 3/150 |
|
|
[考研] 材料 336 求調(diào)劑 +3 | An@. 2026-03-18 | 4/200 |
|
|
[考研] 304求調(diào)劑 +6 | 曼殊2266 2026-03-18 | 6/300 |
|
|
[考研] 295求調(diào)劑 +4 | 一志愿京區(qū)211 2026-03-18 | 6/300 |
|
|
[考研] 一志愿中海洋材料工程專碩330分求調(diào)劑 +8 | 小材化本科 2026-03-18 | 8/400 |
|
|
[考研] 一志愿武漢理工材料工程專碩調(diào)劑 +9 | Doleres 2026-03-19 | 9/450 |
|
|
[考研] 藥學(xué)383 求調(diào)劑 +3 | 藥學(xué)chy 2026-03-15 | 5/250 |
|
|
[考研] 材料學(xué)碩297已過四六級(jí)求調(diào)劑推薦 +11 | adaie 2026-03-19 | 11/550 |
|
|
[考研] 260求調(diào)劑 +3 | 朱芷琳 2026-03-20 | 3/150 |
|
|
[考研] 求調(diào)劑 +3 | @taotao 2026-03-20 | 3/150 |
|
|
[考研] 261求B區(qū)調(diào)劑,科研經(jīng)歷豐富 +3 | 牛奶很忙 2026-03-20 | 4/200 |
|
|
[考研] 281求調(diào)劑(0805) +14 | 煙汐憶海 2026-03-16 | 25/1250 |
|
|
[考研] 286求調(diào)劑 +6 | lemonzzn 2026-03-16 | 10/500 |
|
|
[考研] 312求調(diào)劑 +8 | 陌宸希 2026-03-16 | 9/450 |
|
|
[考研] [導(dǎo)師推薦]西南科技大學(xué)國防/材料導(dǎo)師推薦 +3 | 尖角小荷 2026-03-16 | 6/300 |
|