Convert cross sectional data into surface

조회 수: 3 (최근 30일)
Hassan Qandil
Hassan Qandil 2018년 8월 19일
댓글: Star Strider 2020년 10월 8일
Hi, I have a set of cross sectional data distribution on a certain surface:
[5.8645 11.4836 12.6726 11.587 11.3566 10.2168 9.8317 10.0888 10.6236 10.8221 10.8221 10.6236 10.0888 9.8317 10.2168 11.3566 11.587 12.6726 11.4836 5.8645]
It's symmetrical around the center, how can I create a surface from this data?
  댓글 수: 3
Hassan Qandil
Hassan Qandil 2018년 8월 19일
yes, this is a cross sectional energy distribution over a circular surface of radius 25 mm, so the corresponding cross sectional length would be linspace(-25,25,20)
Hassan Qandil
Hassan Qandil 2018년 8월 19일
so technically the x and y data is symmetrical (circle). and the given data above is the z data (though it is just the cross section value of the surface)

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

채택된 답변

Star Strider
Star Strider 2018년 8월 26일
Here is one possible approach.
The Code
V = [5.8645 11.4836 12.6726 11.587 11.3566 10.2168 9.8317 10.0888 10.6236 10.8221 10.8221 10.6236 10.0888 9.8317 10.2168 11.3566 11.587 12.6726 11.4836 5.8645];
Av = linspace(-1, 1, numel(V))*(10*pi/numel(V));
Rv = linspace(-1, 1, numel(V));
[R,A] = meshgrid(Rv,Av);
Z = ones(numel(Av),1)*V;
[X,Y,Z] = pol2cart(A, R, Z);
figure
surf(X, Y, Z)
grid on
shading(gca,'interp')
view(-30, 50)
The Plot
You will have to experiment to get the result you want, including labeling the axis ticks as you want them.
This will get you started.
  댓글 수: 4
Taiwo Ajayi
Taiwo Ajayi 2020년 10월 8일
Hi Star Strider,
What if you had a non symmetric surface i.e. that is several crossections of vectors V1, V2, ... Is there anyway we can interpolate those crossections to come up with a surface?
Star Strider
Star Strider 2020년 10월 8일
Taiwo Ajayi — It might be possible to interpolate them using griddata or griddedinterpolant, or some other appropriate interpolation function. It would likely be necessary to concatenate them into a matrix first. I’m speculating here, because I have no idea what the data are. It will be necessary to experiment to see what works.

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

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