Info
此问题已关闭。 请重新打开它进行编辑或回答。
engineering formula solve - "index exceeds array bounds"
1 次查看(过去 30 天)
显示 更早的评论
Hello,
this is a rework of a question i'd asked previously; my old cold ended up working fine with help, but my initial algebra was incorrect (multiple terms in denominator). I've re-worked the algebra, but get different error when plotting the equation - here's the code;
clear
clc
%initial parameters
%axial case
r = 1e-3;
d = 0.5e-3;
l = 2e-3;
mu = 0.6;
%equations
P = 200000:100000:2700000;
s = P*r/(2*(r-d));
g = s/2;
Y = ((3*(r^2)*s) - 3*(d^2)*((P)-s))/(2*l*mu(d*g-g*r+3*(P)*r));
plot(Y,P)
Index exceeds array bounds.
Error in iepattempt2 (line 20)
Y = ((3*(r^2)*s) - 3*(d^2)*((P)-s))/(2*l*mu(d*g-g*r+3*(P)*r));
Any assistance is appreciated once more,
Rich
1 个评论
madhan ravi
2019-3-28
编辑:madhan ravi
2019-3-28
Y = ((3*(r^2)*s) - 3*(d^2)*((P)-s))./(2*l*mu*(d*g-g*r+3*(P)*r));
% ^--------^------missing
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!