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!