How do I plot a function up to a certain value and start another function at that value for the same plot?
古いコメントを表示
I'm plotting the power on a hydraulic cylinder over the angle of tilt of the beam that the cylinder is pushing. This is the code I have, and for the plot I want the "red line" to stop at a value of 2, and the "blue line" to start at the value of 2. How do I go about this?
Also, is it possible to connect both lines to represent a drop in power?
This is code:
%Calculations for tilting ONLY
AC=2.125;
Fc=8130.0375;
BD=2;
A=0.03^2.*pi;
%Varying angles
a = 0:45;
Deg=sind(a);
FhN=2.125*Fc*Deg;
Fh=FhN/(BD*2*sind(10));
Ph=(Fh/A)/100000;
P_max=Fh*0.237;
P_rest=Fh*0.147;
% Power on Cylinder for Tilting
figure(1)
subplot(2,2,3)
plot(a,P_max,'r',a,P_rest,'b')
title('Power on HC')
axis([0 inf, 0 inf])
xlabel('Angle')
ylabel('Power [W]')
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
