how can ı fixed

2 次查看(过去 30 天)
ueqweoıqwueoq
ueqweoıqwueoq 2024-3-27
sigma_0 = 2;
theta_deg = [0, 90, 180, 270];
theta_rad = deg2rad(theta_deg);
r = '1.*a':0.1:'2.*a';
sigma_r = zeros(length(r), length(theta_rad));
a = int(input("Yarıçapı Giriniz"))
for i = 1:length(r)
ksi = a./r
end
for
i = 1:length(theta_rad)
theta = theta_rad(i);
sigma_r(:, i) = (1/2.*sigma_0.*(1-(ksi.^2))) - (1/2.*sigma_0.*(1+(3.*(ksi.^4))-(4.*(ksi.^2))).*cos(2.*theta));
end
I want a value a to be entered (as input) and how can I define this value as r and continue increasing by 0.1 from a to 2a?

回答(1 个)

sai charan sampara
sai charan sampara 2024-3-27
Hello Öner,
I understand that you are trying to take variable "a" as input and then define variable "r" as an array with values ranging from "a" to "2*a". It can be done as follows:
sigma_0 = 2;
theta_deg = [0, 90, 180, 270];
theta_rad = deg2rad(theta_deg);
a = input("Enter radius");
r = a:0.1:2*a;
sigma_r = zeros(length(r), length(theta_rad));
for i = 1:length(r)
ksi = a./r;
end
for i = 1:length(theta_rad)
theta = theta_rad(i);
sigma_r(:, i) = (1/2.*sigma_0.*(1-(ksi.^2))) - (1/2.*sigma_0.*(1+(3.*(ksi.^4))-(4.*(ksi.^2))).*cos(2.*theta));
end
You can refer to the following documentation for more information:

类别

Help CenterFile Exchange 中查找有关 Programming Utilities 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by