MATLAB Answers


how to plot line profiles in 3D

Asked by John
on 12 Dec 2011


Could someone please advise me how I can plot this graph in matlab?

This graph just displays 45 profiles side by side and displayed in 3D. Velocity is on Y axis and time is on the x axis.

This is a 2D example

I would really appreciate the help.

Thank you




No products are associated with this question.

3 Answers

Answer by Sean de Wolski
on 12 Dec 2011

mesh will do that with the appropriate settings.

doc mesh


Answer by John
on 12 Dec 2011


I'm not very good at matlab, if I import the coordinates like this:

x = load('x.txt.');
y1 = load('y1.txt.');
y2 = load('y2.txt.');

What would be the command to plot the two lines side by side? so it would be (x,y1) and (x,y2).

Thank you very much


  1 Comment


x/y1 will be a blue and solid, x/y2 will be red dashed

Answer by John
on 13 Dec 2011


What would be the command to plot the lines in the mesh grid so that it looks like this

I used the command above and rotated it but it came out like this

Thanks for the help


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!