Creating a 3D surface plot from a 2D shape

조회 수: 3 (최근 30일)
Tom
Tom 2013년 12월 17일
댓글: Roger Stafford 2013년 12월 18일
I am wanting to create a surface plot of an axisymmetric body using the matlab surfnorm command.
I have the geometry as an X row and Y column vectors.
The line shape is open at one end, and as I had been attempting to utilize the cylinder command with a spurious shape being generated.
I had attempted to use a rotational matrix to generate a set of Z points to create a full set of X,y,z points of the surf command but I feel at a dead stop how to implement this, with loop functions etc.
is there an alternative command or method i could use to create this shape in 3D?
  댓글 수: 2
Thomas Seers
Thomas Seers 2013년 12월 17일
How do you intend to add z info? One option is to create a vector of the same length as x (or y) using the ones or zeros function (your shape will still be flat but will be viewable as a 3D object). e.g.
z = zeros(size(x,1),1); % shape centred at z = 1
z = ones(size(x,1),1); % shape centred at z = 0
you can add noise too
z = zeros(size(x,1),1)+rand(size(x,1),1); % add noise
Besides this I'm not sure how you will arbitrarily add 3D info to your 2D shape
Roger Stafford
Roger Stafford 2013년 12월 18일
What is the axis of rotation for your 2D curve?

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

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