MATLAB: Extend line plot to a Surface

2d to 3d3d3d plotssurfsurface

Hey, I am trying to plot a surface but am struggling to find the right commands. I have a 2D plot of a line going diagonally down. I want to extend this line to the 3rd dimension, so that it creates a surface. Is it possible to do this in MatLab? What commands can I use. Thanks

Best Answer

x=10:-1:1; % your 2d_line
x3d=repmat(x,[numel(x),1]);
surf(x3d);