![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344826/image.png)
Plotting 3D grating
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Arash A.
el 11 de Ag. de 2020
Comentada: Arash Ahmadivand
el 13 de Ag. de 2020
Considering the plots below, I have a problem in adding an extra dimension to a 1D rectangular pulse train. In other words, I am trying to implement a 3D grating in matlab, as shown below. Any help would be appreciated!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344760/image.png)
0 comentarios
Respuesta aceptada
hosein Javan
el 11 de Ag. de 2020
I think this is what you're looking for
x = [1 2 2 3 3 4 4 5 5 6];
z = [0 0 1 1 0 0 1 1 0 0];
y = [1 4];
[X,Y] = meshgrid(x,y)
Z = repmat(z,[length(y) 1])
surf(X,Y,Z,'FaceColor',[0.5 0.5 0.5])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344826/image.png)
6 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!