I'm getting the error below:
arraynum = 3.2220e+03Array indices must be positive integers or logical values.Error in kaboomSpeed (line 3)velocityAtImpact= velocity(arraynum);
but I can type velocity(3.2220e+03) into the command line and it works so why wont it work in my function?
function[velocityAtImpact]= kaboomSpeed(velocity,lengthOfFlight,dt)arraynum=lengthOfFlight/dtvelocityAtImpact= velocity(arraynum);end
Thanks in advance to anyone who can help me with this.
Best Answer