how can ı fixed

2 ビュー (過去 30 日間)
ueqweoıqwueoq
ueqweoıqwueoq 2024 年 3 月 27 日
編集済み: Rena Berman 2024 年 4 月 3 日
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 件のコメント
Rena Berman
Rena Berman 2024 年 4 月 3 日

(Answers Dev) Restored edit

サインインしてコメントする。

回答 (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 Center および File ExchangeProgramming Utilities についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by