c=app.CKPaEditField.Value;
P_ya=app.P_yaEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L_s=app.L_smEditField.Value;
term1 = 9 - 12 * (1 - P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) - 3 .* R;
pha = atan(term2 ./ denominator);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
plot(app.UIAxes,H_vals, pha_vals, 'b-', 'LineWidth', 2);
ylabel(app.UIAxes,'pha');
title(app.UIAxes,'Plot of pha vs H');
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
sigma2=Lc2.*H.*K.*y.*H./2;
t2=Lc2.*c.*H+sigma2.*tan(P)
eq=Wr2+t2==F.*(F2+Fbc2+Fbr2)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = '竖直滑面法示意图.png';
app.Image_2.ImageSource = '竖直滑面法示意图2.png';
elseif app.Button.Value==1
sigma1=Lc1.*H.*K.*y.*H./2;
t1=Lc1.*c.*H+sigma1.*tan(P)
eq=Wr1+t1==F.*(F1+Fbc1+Fbr1)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = '竖直滑面法示意图.png';
app.Image_2.ImageSource = '竖直滑面法示意图2.png';