how can ı fixed

2 visualizaciones (últimos 30 días)
ueqweoıqwueoq
ueqweoıqwueoq el 27 de Mzo. de 2024
Editada: Rena Berman el 3 de Abr. de 2024
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 comentario
Rena Berman
Rena Berman el 3 de Abr. de 2024

(Answers Dev) Restored edit

Iniciar sesión para comentar.

Respuestas (1)

sai charan sampara
sai charan sampara el 27 de Mzo. de 2024
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:

Categorías

Más información sobre Programming Utilities en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by