The best way is tolearn how to use the debugger. In this instance, issuingdbstop if error and looking at the states of the variables and experimenting at the command line when the program breaks into the debugger because of the error would show you the problem.
The problem is simple, yournewton_simple.m code expects two functionsf anddf that returns a scalar value given a scalar input. Yourdf functiondoes not return a scalar value when given a scalar input because that'spolyder does not return scalar values. I suspect you never meant to usepolyder but who knows?