| 4 | 1/1 | 返回列表 |
| 查看: 1591 | 回復: 3 | |||
lixixiao2銅蟲 (小有名氣)
|
[求助]
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 ] |
木蟲 (正式寫手)
|
你的矩陣維數不一致, 關于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è)作家)
![]() |
專家經驗: +831 |

| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿華中科技大學071000,求調劑 +4 | 沿岸有貝殼6 2026-03-21 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 資源與環(huán)境 調劑申請(333分) +5 | holy J 2026-03-21 | 5/250 |
|
|
[考研] 一志愿南大,0703化學,分數336,求調劑 +3 | 收到VS 2026-03-21 | 3/150 |
|
|
[考研] 求調劑 +3 | 13341 2026-03-20 | 3/150 |
|
|
[考研] 求調劑 +6 | Mqqqqqq 2026-03-19 | 6/300 |
|
|
[考研] 304求調劑 +6 | 曼殊2266 2026-03-18 | 6/300 |
|
|
[考研] 南京大學化學376求調劑 +3 | hisfailed 2026-03-19 | 6/300 |
|
|
[考研] 一志愿中海洋材料工程專碩330分求調劑 +8 | 小材化本科 2026-03-18 | 8/400 |
|
|
[考研] 317求調劑 +5 | 申子申申 2026-03-19 | 9/450 |
|
|
[考研] 北科281學碩材料求調劑 +5 | tcxiaoxx 2026-03-20 | 5/250 |
|
|
[考研] 材料學求調劑 +4 | Stella_Yao 2026-03-20 | 4/200 |
|
|
[考研] 一志愿 南京航空航天大學大學 ,080500材料科學與工程學碩 +5 | @taotao 2026-03-20 | 5/250 |
|
|
[考研] 工科材料085601 279求調劑 +7 | 困于星晨 2026-03-17 | 9/450 |
|
|
[考博] 申博26年 +3 | 八6八68 2026-03-19 | 3/150 |
|
|
[考博] 26博士申請 +3 | 1042136743 2026-03-17 | 3/150 |
|
|
[考研] 290求調劑 +3 | p asserby. 2026-03-15 | 4/200 |
|
|
[考博] 26申博 +4 | 八6八68 2026-03-16 | 4/200 |
|
|
[考研] 283求調劑 +3 | 聽風就是雨; 2026-03-16 | 3/150 |
|
|
[考研] [導師推薦]西南科技大學國防/材料導師推薦 +3 | 尖角小荷 2026-03-16 | 6/300 |
|
|
[考研] 070300化學學碩求調劑 +6 | 太想進步了0608 2026-03-16 | 6/300 |
|