Azzera filtri
Azzera filtri

How do I add a flat line on the z-axis?

18 visualizzazioni (ultimi 30 giorni)
Luis
Luis il 5 Mar 2023
Risposto: Voss il 5 Mar 2023
I figured out how to code my function, but I am being asked to add the ultimate stress alongside my graph, which would be a flat line on the z axis at Z=40. I tried doing this the same way as a flat line would be added on the y axis (yline[ ]), but it does not work. Any assistance is greatly appreciated. Thank you!
Here is my code:
[x,y]=meshgrid(0:0.0001:0.004,-pi/4:0.1:pi/4)
c=cos(y).*sqrt(pi.*x)
d=cos(y).^2
e=sin(y).^2
KI2=0.78^2
KII2=1.47^2
f=(d/KI2)+(e/KII2)
g=sqrt(f)
h=c.*g
z=1./h
surf(z)
xlabel("Crack Size (a)")
ylabel("Angle (b)")
zlabel("Critical Stress")
title("Failure Envelope Surface")

Risposta accettata

Voss
Voss il 5 Mar 2023
[x,y]=meshgrid(0:0.0001:0.004,-pi/4:0.1:pi/4);
c=cos(y).*sqrt(pi.*x);
d=cos(y).^2;
e=sin(y).^2;
KI2=0.78^2;
KII2=1.47^2;
f=(d/KI2)+(e/KII2);
g=sqrt(f);
h=c.*g;
z=1./h;
surf(z)
xlabel("Crack Size (a)")
ylabel("Angle (b)")
zlabel("Critical Stress")
title("Failure Envelope Surface")
hold on
surf(40*ones(size(z)),'FaceColor','r','FaceAlpha',0.3,'EdgeColor','none')

Più risposte (0)

Categorie

Scopri di più su Stress and Strain in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by