(Answers Dev) Restored edit
how can ı fixed
2 次查看(过去 30 天)
显示 更早的评论
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
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programming Utilities 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!