필터 지우기
필터 지우기

Plot of surface with vectors

조회 수: 7 (최근 30일)
Søren Schwartz
Søren Schwartz 2015년 11월 8일
댓글: Star Strider 2015년 11월 8일
Hello, I want to plot a surface, but I have my variables in vector form x=1884x1, y=1884x1 and z=1884x1. This does not fit the dimension that are needed to plot a surface. How can I continue?

채택된 답변

Star Strider
Star Strider 2015년 11월 8일
Depending on what you want your plot to look like, I would use either scatter3 or plot3.
If your data are in a sense gridded (your x or y vectors have regularly-repeating segments for example) you could use reshape and then use a surface plot.
Without your data or an image, it is not possible to provide a definitive reply.
  댓글 수: 2
Søren Schwartz
Søren Schwartz 2015년 11월 8일
I have now attached the variabels. I have regularly-repeating segments, but I have never used reshape. I tried sort and then plot, but it still gives problem.
Star Strider
Star Strider 2015년 11월 8일
Your data are repeating but not regularly repeating, so reshape is not going to work. They also do not appear to me to be appropriate for a surface plot, since that would require significant interpolation.
I would use stem3 (since that locates each point in Z to particular coordinates on the (X,Y) plane), although scatter3 would work as well:
I1 = load('Søren Schwartz x.mat');
X = I1.MNSv;
I2 = load('Søren Schwartz y.mat');
Y = I2.Tv;
I3 = load('Søren Schwartz z.mat');
Z = I3.Calls;
figure(1)
stem3(X, Y, Z, '.')
grid on
That is likely as close as you can get to a 3D plot with your data.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by