Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

engineering formula solve - "index exceeds array bounds"

1 Ansicht (letzte 30 Tage)
Richard Gray
Richard Gray am 28 Mär. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
madhan ravi
madhan ravi am 28 Mär. 2019
Bearbeitet: madhan ravi am 28 Mär. 2019
Y = ((3*(r^2)*s) - 3*(d^2)*((P)-s))./(2*l*mu*(d*g-g*r+3*(P)*r));
% ^--------^------missing

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by