How to plot 2D graphs (no function) over time into 3D?

조회 수: 1 (최근 30일)
Dominik
Dominik 2012년 9월 23일
Hello,
I look for a way to plot 2D graphs (x,y) over time (z) into 3D structure. My problem is, that the 2D graph is not a function, so it's plotted by 100 values of x and y for each z value.
I tried several ways, for example the plot3() function including a loop, but then the vectors don't have the same length. And using surf() demands a function for z, but I have just a vector.
Thank you for your support, Dominik

답변 (1개)

Walter Roberson
Walter Roberson 2012년 9월 24일
surf() never wants a function: surf works on a rectangular data array.
all_z = [z1(:), z2(:), z3(:)];
surf(x, y, all_z)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by