Common part of 2D and 3D plot
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
M
el 5 de Jun. de 2022
Comentada: Star Strider
el 7 de Jun. de 2022
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 comentarios
Respuesta aceptada
Star Strider
el 5 de Jun. de 2022
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 comentarios
Más respuestas (1)
Sam Chak
el 6 de Jun. de 2022
Editada: Sam Chak
el 6 de Jun. de 2022
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 comentarios
Ver también
Categorías
Más información sobre Contour Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!