How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files?
%How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files? And how can I change it in my code
cla(app.UIAxes)
P=app.PEditField.Value
P=P.*pi/180;
c=app.CKPaEditField.Value;
K=app.KEditField.Value;%侧压力系数
P_ya=app.P_yaEditField.Value;
F=app.FEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L=app.LmEditField.Value;
L_s=app.L_smEditField.Value;
syms pha H
term1 = 9 – 12 * (1 – P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) – 3 .* R;
denominator = 2 .* H;
% 计算 pha
pha = atan(term2 ./ denominator);
% 显示结果
% disp(pha);
pha_rad=rad2deg(pha);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
% Plot H versus pha
% figure(1);
plot(app.UIAxes,H_vals, pha_vals, ‘b-‘, ‘LineWidth’, 2);
xlabel(app.UIAxes,’H’);
ylabel(app.UIAxes,’pha’);
title(app.UIAxes,’Plot of pha vs H’);
% grid on;
% disp(pha_rad);
%修正破裂角计算
if K <= 1
pha_rad = 45 – P / 2;
elseif K <= 2
pha_rad = 45;
else
pha_rad = 45 + P / 2;
end
% 限制 pha_rad 的值在 15° 和 65° 之间
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
case ‘竖直滑面法’
if app.Button_2.Value==1
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);%体积
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
Lc2=2*pi.*R+(L-2*R).*2;%周长
sigma2=Lc2.*H.*K.*y.*H./2;
Fbc2=Vc2.*10;%
Fbr2=Ac2.*10.*(H-L_s);
F2=Ac2.*P_ya;
Wr2=y.*H.*Ac2;%
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
Vc1=4.*pi.*R.^3;%体积
Ac1=pi.*R.^2;%表面积
Lc1=2*pi.*R;%周长
sigma1=Lc1.*H.*K.*y.*H./2;%水平应力和∑σh
Fbc1=Vc1.*10;%硐室浮力
Fbr1=Ac1.*10.*(H-L_s);%岩体浮力
F1=Ac1.*P_ya;%上抬力
Wr1=y.*H.*Ac1;%重量
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’; % 直接用路径
end%How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files? And how can I change it in my code
cla(app.UIAxes)
P=app.PEditField.Value
P=P.*pi/180;
c=app.CKPaEditField.Value;
K=app.KEditField.Value;%侧压力系数
P_ya=app.P_yaEditField.Value;
F=app.FEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L=app.LmEditField.Value;
L_s=app.L_smEditField.Value;
syms pha H
term1 = 9 – 12 * (1 – P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) – 3 .* R;
denominator = 2 .* H;
% 计算 pha
pha = atan(term2 ./ denominator);
% 显示结果
% disp(pha);
pha_rad=rad2deg(pha);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
% Plot H versus pha
% figure(1);
plot(app.UIAxes,H_vals, pha_vals, ‘b-‘, ‘LineWidth’, 2);
xlabel(app.UIAxes,’H’);
ylabel(app.UIAxes,’pha’);
title(app.UIAxes,’Plot of pha vs H’);
% grid on;
% disp(pha_rad);
%修正破裂角计算
if K <= 1
pha_rad = 45 – P / 2;
elseif K <= 2
pha_rad = 45;
else
pha_rad = 45 + P / 2;
end
% 限制 pha_rad 的值在 15° 和 65° 之间
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
case ‘竖直滑面法’
if app.Button_2.Value==1
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);%体积
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
Lc2=2*pi.*R+(L-2*R).*2;%周长
sigma2=Lc2.*H.*K.*y.*H./2;
Fbc2=Vc2.*10;%
Fbr2=Ac2.*10.*(H-L_s);
F2=Ac2.*P_ya;
Wr2=y.*H.*Ac2;%
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
Vc1=4.*pi.*R.^3;%体积
Ac1=pi.*R.^2;%表面积
Lc1=2*pi.*R;%周长
sigma1=Lc1.*H.*K.*y.*H./2;%水平应力和∑σh
Fbc1=Vc1.*10;%硐室浮力
Fbr1=Ac1.*10.*(H-L_s);%岩体浮力
F1=Ac1.*P_ya;%上抬力
Wr1=y.*H.*Ac1;%重量
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’; % 直接用路径
end %How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files? And how can I change it in my code
cla(app.UIAxes)
P=app.PEditField.Value
P=P.*pi/180;
c=app.CKPaEditField.Value;
K=app.KEditField.Value;%侧压力系数
P_ya=app.P_yaEditField.Value;
F=app.FEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L=app.LmEditField.Value;
L_s=app.L_smEditField.Value;
syms pha H
term1 = 9 – 12 * (1 – P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) – 3 .* R;
denominator = 2 .* H;
% 计算 pha
pha = atan(term2 ./ denominator);
% 显示结果
% disp(pha);
pha_rad=rad2deg(pha);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
% Plot H versus pha
% figure(1);
plot(app.UIAxes,H_vals, pha_vals, ‘b-‘, ‘LineWidth’, 2);
xlabel(app.UIAxes,’H’);
ylabel(app.UIAxes,’pha’);
title(app.UIAxes,’Plot of pha vs H’);
% grid on;
% disp(pha_rad);
%修正破裂角计算
if K <= 1
pha_rad = 45 – P / 2;
elseif K <= 2
pha_rad = 45;
else
pha_rad = 45 + P / 2;
end
% 限制 pha_rad 的值在 15° 和 65° 之间
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
case ‘竖直滑面法’
if app.Button_2.Value==1
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);%体积
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
Lc2=2*pi.*R+(L-2*R).*2;%周长
sigma2=Lc2.*H.*K.*y.*H./2;
Fbc2=Vc2.*10;%
Fbr2=Ac2.*10.*(H-L_s);
F2=Ac2.*P_ya;
Wr2=y.*H.*Ac2;%
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
Vc1=4.*pi.*R.^3;%体积
Ac1=pi.*R.^2;%表面积
Lc1=2*pi.*R;%周长
sigma1=Lc1.*H.*K.*y.*H./2;%水平应力和∑σh
Fbc1=Vc1.*10;%硐室浮力
Fbr1=Ac1.*10.*(H-L_s);%岩体浮力
F1=Ac1.*P_ya;%上抬力
Wr1=y.*H.*Ac1;%重量
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’; % 直接用路径
end matlab gui MATLAB Answers — New Questions