MATLAB: Index in position 1 exceeds array bounds (must not exceed 1).

arrayerrorindex

Getting the error code in the title
Code:
New to matlab so thanks for any assistance and patience. I imagine the solution is simple but cannot find it.

Best Answer

Have you created a variable named mass in your workspace? If so, that line of code you wrote will attempt to index into that variable rather than attempting to call your function. If you need the contents of that variable create a new variable with a different name then clear the variable named mass and try calling your function again.