Plot 3D with mesh points known

3 ビュー (過去 30 日間)
Thanasis Hou
Thanasis Hou 2017 年 4 月 25 日
回答済み: KSSV 2017 年 4 月 26 日
Hello,
I am encountered a problem with plotting. I solved a linear system(9x9) of equations (x = inv(A)*b). I have a 5x5 grid over 0<x<4 and 0<y<4 wiht boundary conditions. I want to depict the results in 3D. The solution gives (interior points)
x = [u2,2; u3,2; u4,2; u2,3; u3,3; u4,3; u2,4; u3,4; u4,4]
In addition, for x = 0 I have the BC points, u1,4 = u1,3 = u1,2 = 80
for x = 4, u5,4 = u5,3 = u5,2 = 0
for y = 0, u2,1 = u3,1 = u4,1 = 20
for y = 4, u2,5 = u3,5 = u4,5 = 180.
How can I make a 3D plot (surface) with these?
  2 件のコメント
KSSV
KSSV 2017 年 4 月 26 日
Your given data is quite confusing. Note that surf plots 3D surface. Read about surf
Thanasis Hou
Thanasis Hou 2017 年 4 月 26 日
編集済み: Thanasis Hou 2017 年 4 月 26 日

I attached an image with the grid. I have the values of the elements of matrix x. The points of the grid have different position in the matrix.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2017 年 4 月 26 日
x = 0:4 ;
y = 0:4 ;
[X,Y] = meshgrid(x,y) ;
U = rand(size(X)) ; % you have to find the interior points, I have taken random
U(:,1) = 80 ;
U(1,:) = 180 ;
U(:,end) = 0 ;
U(end,:) = 20 ;
surf(X,Y,U)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by