How can I sive Error using plot Vectors must be the same lengths.
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Input Data Pm=8.57; Ps=19; PV=7; YP=7; ROP=54; RPM=80; Dcut=0.175; Dp=2.375; Dh=5; %Calculation of Cutting Velocity Cconc=(0.01778*ROP)+0.505; Vcut=ROP/(36*(1-(Dp/Dh)^2)*Cconc); %Calculation of Slip Velocity Vs1=1; n=0; Vslip=0.2; while(abs(Vslip-Vs1)>0.001) n=n+1; Vmin=Vcut+Vslip; Ua=PV+(5*YP*(Dh-Dp))/Vmin; Re=(928*Pm*Dcut*Vs1)/Ua; if (Re<3) f=40/Re; elseif ((Re>3)&&(Re<300)) f=22/sqrt(Re); else f=1.54; end Vslip=f*(sqrt(Dcut*((Ps-Pm)/Pm))); Vs1=(Vslip+Vs1)/2; end %Calculation of Critical velocity Ang=zeros(90); for i=(1:90) Ang(i)=i; if (Ang(i)<=45) Vcrit=Vcut+Vslip*(1+(Ang(i)*(600-RPM)*(3+Pm)/202500)); else Vcrit=Vcut+Vslip*((1+(3+Pm)*(600-RPM)/4500)); end end plot(Ang,Vcrit) grid on title('Graph of Minimun Velocity against Hole Angle') xlabel('Angle (deg)') ylabel('Min Velocity (ft/sec)')
0 件のコメント
回答 (1 件)
Star Strider
2015 年 3 月 21 日
Your ‘Ang’ variable is a (90x90) matrix, ‘Vcrit’ is a scalar.
Change ‘Ang’ to a vector, subscript ‘Vcrit’ in the last loop before the plot, and the plot works:
%Calculation of Critical velocity
Ang=zeros(90,1); % <— Second Argument (‘1’) Creates Vector
for i=(1:90)
Ang(i)=i;
if (Ang(i)<=45)
Vcrit(i)=Vcut+Vslip*(1+(Ang(i)*(600-RPM)*(3+Pm)/202500));
else
Vcrit(i)=Vcut+Vslip*((1+(3+Pm)*(600-RPM)/4500));
end
end
2 件のコメント
Emeka Igwilo
2015 年 3 月 22 日
Star Strider
2015 年 3 月 22 日
My pleasure!
If my Answer solved your problem, please Accept it.
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!