Not showing all 5 plots

2 ビュー (過去 30 日間)
Corey Bullard
Corey Bullard 2012 年 4 月 27 日
There should be 5 similar plots in 5 windows (later I will put them in to a figure). There is only one.
Also I will make a loop.
Anyway, here's the business end of my program:
t = 0:.01:1;
l_value = l(1);
v1 = velocity( r, angular_velocity, t, l_value );
max_flow1 = max(v)*piston_area;
disp(['For l = ' num2str(l_value) ' the peak flow rate is ' num2str(max_flow1) ' in^3/sec' ]);
l_value = l(2);
v2 = velocity( r, angular_velocity, t, l_value );
max_flow1 = max(v)*piston_area;
disp(['For l = ' num2str(l_value) ' the peak flow rate is ' num2str(max_flow1) ' in^3/sec' ]);
l_value = l(3);
v3 = velocity( r, angular_velocity, t, l_value );
max_flow1 = max(v)*piston_area;
disp(['For l = ' num2str(l_value) ' the peak flow rate is ' num2str(max_flow1) ' in^3/sec' ]);
l_value = l(4);
v4 = velocity( r, angular_velocity, t, l_value );
max_flow1 = max(v)*piston_area;
disp(['For l = ' num2str(l_value) ' the peak flow rate is ' num2str(max_flow1) ' in^3/sec' ]);
l_value = l(5);
v5 = velocity( r, angular_velocity, t, l_value );
max_flow1 = max(v)*piston_area;
disp(['For l = ' num2str(l_value) ' the peak flow rate is ' num2str(max_flow1) ' in^3/sec' ]);
%plot the flows
plot(t,v1*piston_area, 'r:' );
plot(t,v2*piston_area, 'g:');
plot(t,v3*piston_area, 'g:');
plot(t,v4*piston_area, 'g:');
plot(t,v5*piston_area, 'g:');
If I add each plot statement to a separate figure, they look fine. However, I need them in one figure.
Here is my velocity function:
v = -r.*angular_velocity.*(sin(angular_velocity.*t) + r./(2*l_value).*sin(2.*angular_velocity.*t).*(1 - (r./l_value.*sin(angular_velocity.*t)).^2).^-0.5);

採用された回答

Ilham Hardy
Ilham Hardy 2012 年 4 月 27 日
Use command:
hold on
after the first plot command

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by