finding solutions in matlab within interval for multiple variables

조회 수: 1 (최근 30일)
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!

채택된 답변

Sibi
Sibi 2020년 11월 18일
편집: Sibi 2020년 11월 18일
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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by