Info

この質問は閉じられています。 編集または回答するには再度開いてください。

engineering formula solve - "index exceeds array bounds"

1 回表示 (過去 30 日間)
Richard Gray
Richard Gray 2019 年 3 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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
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 件)

この質問は閉じられています。

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by