필터 지우기
필터 지우기

i have two matrix and want to plot an surf so how to keep my z axies along with my two matrix.

조회 수: 2 (최근 30일)
i have two matrix of 61 co-ordinates
i want to give an z-axies which have my both x & y and have to spread along z axies.
  댓글 수: 7
Walter Roberson
Walter Roberson 2019년 10월 14일
Does it just have to look like a wireframe cuboid grid, or do you need each cuboid to be individually constructed with proper vertex order such as for CAD purposes or lighting purposes?
Your x and y vertices do not appear to be in sorted order: is it okay to sort them and create the implied cuboid, or is there significance to the order implying something about connectivity ?
D KUSHAL KUMAR
D KUSHAL KUMAR 2019년 10월 14일
nope just the cuboid grid is enough. Just the plot should be in 3 planes that is enough.

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

답변 (1개)

Sammit Jain
Sammit Jain 2020년 1월 28일
Hi Kushal,
It seems that the data you shared may not be in accordance with the requirement you have. However, working on the assumption that all the vectors, X, Y and Z are of the same length, then I believe you're looking for plot3. See the documentation here: https://www.mathworks.com/help/matlab/ref/plot3.html
Assuming here that all 3 coordinates are available and it is indeed a 3d plot. If that is a desired scenario, then simply plot3(X,Y,Z) should resolve the query.
Not sure what is intended by "spread along z axis", could you perhaps give an example? From the comments, it seems that the desired output is a 3d plot, even though only two coordinates are available.
A possible solution in that scenario will be to simply put 0 in all the Z axis values to see a 3d plot.
For example, if X = [2 3 4], Y = [10, 20, 30]. Assign Z = [0 0 0]. Then plot3(X,Y,Z) should work.

카테고리

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