  An $[a,b]$-factor of a graph $G$ is a spanning subgraph $H$ such that $a\leq
d_{H}(v)\leq b$ for each $v\in V(G)$. In this paper, we provide spectral
conditions for the existence of an odd $[1,b]$-factor in a connected graph with
minimum degree $\delta$ and the existence of an $[a,b]$-factor in a graph,
respectively. Our results generalize and improve some previous results on
perfect matchings of graphs. For $a=1$, we extend the result of O\cite{S.O} to
obtain an odd $[1,b]$-factor and further improve the result of Liu, Liu and
Feng\cite{W.L} for $a=b=1$. For $n\geq 3a+b-1$, we confirm the conjecture of
Cho, Hyun, O and Park\cite{E.C}. We conclude some open problems in the end.
