Common part of 2D and 3D plot
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I have a 3D plot that are plotted based on data (the data attached and shown with blue in the figure below), and a 2d curve on the yz plane. I want to know which part of 2d curve is on the 3d plot. here is the information for the figure:
For 2D plot on the yz: f=0.07.*z.^2./(0.09+z.^2) and g=0.003+0.01.*(42./(42+(y-z).^4)) and I want to plot g-f=0 in yz plane.
and 3D curve has data attached here. for example in this figure that is 3d I want to know where is the 2D curve on the yz plane that I showed. I would appreciate any help
A = importdata(curve3dfinal)
댓글 수: 0
채택된 답변
Star Strider
2022년 6월 5일
I am not certain what result you want.
It is straightforward to rotate the 3D plot to give a 2D view from the Z-axis —
Uz = unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022280/curve3dfinal.zip');
% type(Uz{1})
C3DF = readmatrix(Uz{1})
x = C3DF(:,1);
y = C3DF(:,2);
z = C3DF(:,3);
figure
plot3(x, y, z)
grid on
view(20,30)
xlabel('X')
ylabel('Y')
zlabel('Z')
title('3D View')
figure
plot3(x, y, z)
grid on
view(0,90)
xlabel('X')
ylabel('Y')
zlabel('Z')
title('View From Z-Axis')
.
댓글 수: 13
추가 답변 (1개)
Sam Chak
2022년 6월 6일
편집: Sam Chak
2022년 6월 6일
HI @M
If the points of the desired function h are projected to the y–z plane, then the curve should look like this:
f = @(z) 0.07*z.^2./(0.09 + z.^2);
g = @(z, y) 0.003 + 0.01*(42./(42 + (y - z).^4));
fcn = @(z, y) g(z, y) - f(z);
fyz = fimplicit(fcn, [-0.15 0.15 -5 5]);
z = fyz.XData;
y = fyz.YData;
plot(y, z, 'linewidth', 1.5)
On 3D, I think the function looks like this:
h = 0.003 + 0.01*(42./(42 + (y - z).^4)) - (0.07*z.^2./(0.09 + z.^2));
plot3(y, z, h, 'linewidth', 1.0)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!