finding solutions in matlab within interval for multiple variables

2 visualizaciones (últimos 30 días)
My r_o varies between 12 and 15; anf r_i between 6 and 9;
I need to have a graph velocity VS two radii. The radii are not dependeent on each other, so there might be any combination.
How can I do so?
% Given
W_g = 500;
W_t = 1000;
delta_x = 60;
g = 32.2;
r_i = 6:0.3:9;
r_o = 12:0.3:15;
% Equation for both gliders
V_g_c = sqrt(2*W_t*delta_x*g.*r_o.^2/(W_t.*r_i.^2+W_g.*r_o.^2));
%Plot
plot(V_g_c, r_i, 'Linewidth',2);
Thank you in advance!

Respuesta aceptada

Sibi
Sibi el 18 de Nov. de 2020
Editada: Sibi el 18 de Nov. de 2020
W_g = 500;
W_t = 1000;
delta_x = 60;
g = 32.2;
r_i = 6:0.3:9;
r_o = 12:0.3:15;
V_g_c = sqrt((2*W_t*delta_x*g.*(r_o.^2))./(W_t.*(r_i.^2)+W_g.*(r_o.^2)));
plot(V_g_c, 'Linewidth',2);
if you want all combinations
W_g = 500;
W_t = 1000;
delta_x = 60;
g = 32.2;
r_i = 6:0.3:9;V_g_c=[];
for r_o = 12:0.3:15
k=(sqrt((2*W_t*delta_x*g.*(r_o.^2))./(W_t.*(r_i.^2)+W_g.*(r_o.^2))));
V_g_c = [V_g_c k'];
end
plot(12:0.3:15,V_g_c ,'Linewidth',2);

Más respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by