Common part of 2D and 3D plot
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022425/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022425/image.png)
A = importdata(curve3dfinal)
0 Commenti
Risposta accettata
Star Strider
il 5 Giu 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 Commenti
Più risposte (1)
Sam Chak
il 6 Giu 2022
Modificato: Sam Chak
il 6 Giu 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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022780/image.png)
On 3D, I think the function
looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022795/image.png)
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1022800/image.png)
0 Commenti
Vedere anche
Categorie
Scopri di più su Contour Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!