# How to plot planes parallel to the coordinate axes given by

14 views (last 30 days)
Atom on 10 Jul 2022
Commented: Voss on 10 Jul 2022
How to plot planes parallel to the coordinate axes given by
y = linspace(0,5) ;
x = linspace(0,5) ;
[Y,X] = meshgrid(y,x) ;
Z = 3 ;
surf(X,Y,Z)
hold on
x = linspace(0,5) ;
z = linspace(0,5) ;
[Z,X] = meshgrid(z,x) ;
Y = 2 ;
surf(X,Y,Z)
hold on
y = linspace(0,5) ;
z = linspace(0,5) ;
[Z,Y] = meshgrid(z,y) ;
X = 1 ;
surf(X,Y,Z)

Voss on 10 Jul 2022
Edited: Voss on 10 Jul 2022
y = linspace(0,5) ;
x = linspace(0,5) ;
[Y,X] = meshgrid(y,x) ;
% Z = 3 ;
Z = 3*ones(size(X));
surf(X,Y,Z)
hold on
x = linspace(0,5) ;
z = linspace(0,5) ;
[Z,X] = meshgrid(z,x) ;
% Y = 2 ;
Y = 2*ones(size(X));
surf(X,Y,Z)
hold on
y = linspace(0,5) ;
z = linspace(0,5) ;
[Z,Y] = meshgrid(z,y) ;
% X = 1 ;
X = ones(size(Y));
surf(X,Y,Z)
##### 2 CommentsShowHide 1 older comment
Voss on 10 Jul 2022
A matrix of ones the same size as X. This is done because X, Y, and Z need to be compatible sizes in surf (in this case I'm making X, Y, and Z all the same size).
References: ones, size