3D surface plot with unequally space points on x-axis

조회 수: 5 (최근 30일)
Michael
Michael 2014년 6월 27일
편집: Michael 2014년 6월 27일
Hi there,
I have plotted a 3D graph using the surf(X) function with a matrix X where its rows denote time and the columns another time index which has unequally spaced points. So I have 9 columns which consists of 3 months, 6 months, 1 year ,2 years, 5 years etc. How can I plot this graph with the appropriate distance between the values in the columns?
Kind regards,
Michael
  댓글 수: 1
Michael
Michael 2014년 6월 27일
편집: Michael 2014년 6월 27일
Okay, I have found this solution using the mesh function which works.
[X,Y] = meshgrid(x,y);
Z = fun(X,Y);% or Z - array double with size [length(x),length(y)]
mesh(X,Y,Z)
However, with the surf() function the surface is actually coloured. Can this be done with the mesh function aswell?

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

답변 (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