Info

This question is closed. Reopen it to edit or answer.

engineering formula solve - "index exceeds array bounds"

1 view (last 30 days)
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 Comment
madhan ravi
madhan ravi on 28 Mar 2019
Edited: madhan ravi on 28 Mar 2019
Y = ((3*(r^2)*s) - 3*(d^2)*((P)-s))./(2*l*mu*(d*g-g*r+3*(P)*r));
% ^--------^------missing

Answers (0)

This question is closed.

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!