I have a colleagues code that takes a 2D plot and makes a 3D profile by rotating round the centre axis I believe using this code;
% Interpolation of the shape of the 2D grid
z_f = zeros(4096,4096);
r_f = nm_per_px.*sqrt((Gx(Grid == 1)).^2+(Gy(Grid == 1)).^2);
z_f(Grid == 1) = interp1(r_for_smooth,z_for_smooth,r_f);
I had input to this code two straight lines that form a point (shown below)and will thus end up a 3D cone. What I wish to do is change his code so that it makes a pyramid instead. Any help is appreciated.
My point code;
FoV = 7000
N = 100000;
r = [-FoV/2:FoV/N:FoV/2];
z(r<0) = (-(1/7)*r(r<0));
z(r>0) = ((1/7)*r(r>0));

댓글 수: 2

Jan
Jan 2015년 5월 4일
편집: Jan 2015년 5월 4일
Please format the code to make it readable. Use the "{} Code" button.
A question: Did you see that your code is not readable? So many users do not care about this obvious fact and I cannot understand, why it is not important for them to make it is easy as possible for the readers. Only a tiny part of the users add a notice, that they recognize the messy appearance.
Paul Hill
Paul Hill 2015년 5월 4일
sorry

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Surfaces, Volumes, and Polygons에 대해 자세히 알아보기

질문:

2015년 5월 4일

편집:

Jan
2015년 5월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by