How to create the two-layer grid?

1 Ansicht (letzte 30 Tage)
vaya putra
vaya putra am 8 Nov. 2017
Kommentiert: vaya putra am 8 Nov. 2017
I find codding but in my mind it's not explained clearly that it is two layers.
%%Create the grid: a simple cartesian grid, 100m x 100m and 50 blocks on x
% and y directions.
% Two layer grid
x_size = 100;
y_size = 100;
z_size = 1;
Nx = 20;
Ny = 20;
Nz = 1;
G = cartGrid([Nx Ny Nz],[x_size y_size z_size]);
G = computeGeometry(G);
figure(1)
plotGrid(G);view(3);

Antworten (1)

KSSV
KSSV am 8 Nov. 2017
%%simple cartesian grid
L = 100 ; B = 100 ;
nx = 50 ; ny = 50 ;
x = linspace(0,L,nx) ;
y = linspace(0,B,ny) ;
[X,Y] = meshgrid(x,y) ;
mesh(X,Y)
%%Two layer grid
Z1 = zeros(size(X)) ;
Z2 = ones(size(X)) ;
figure
hold on
surf(X,Y,Z1)
surf(X,Y,Z2)
  3 Kommentare
KSSV
KSSV am 8 Nov. 2017
Why don't you show a pictorial example of what you want?
vaya putra
vaya putra am 8 Nov. 2017
here is the sample that i want.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Complex Logic finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by