MATLAB: How to solve Index exceeds the number of array elements (1).

arrayerrorindexMATLAB

lambda=300
mu=3600/10
Rho=lambda/mu
P0=(Rho^0)*(1-Rho)
EX=Rho/(1-Rho)
ELq=Rho^2/(1-Rho)
ET=(1/(mu-lambda))*60*60
ETq=(lambda/(mu(mu-lambda)))
in the final step error appears as "Index exceeds the number of array elements (1)."

Best Answer

mu(mu-lambda) is a request to calculate mu-lambda and to use that as an index into the variable mu.
MATLAB does not have an implicit multiplication.
... I think the next computer language I design is not going to have any implicit multiplication, and is not going to use () or [] for indexing or function calls, specifically so it can give an error message about multiplication being required. Maybe I will go back to RPN notation...
Related Question