One of the simplest ways to do it is to split the region you're searching into subregions, find regions that have endpoints with opposite signs, and then do a more refined search (like you've already written) on the qualifying subregions. I'm not familiar with MATLAB specifically, but here's some Python-flavored pseudocode. a is the lower bound, b the upper bound, and f the function:
a = 1
b = 3
for i in range(1000): # Loops 1000 times
nextval = a + (b - a)/1000 # Increments by 1/1000 of the region
fa = f(a)
fnext = f(nextval)
if fa < 0 < fnext:
# do more refined search
elif fnext < 0 < fa:
# do more refined search
a = nextval # Moves <a> forward so a new region is checked on the next iteration
If you're into polynomials specifically, you may be able to solve them exactly. See this page http://en.wikipedia.org/wiki/Cubic_function for more information.