You should probably heed the warnings about deprecation and use mmreader.m
However, the problem seems more that MATLAB cannot find sample.avi Is this file located in a folder that is on the MATLAB path?
Use addpath() or pathtool to add that folder to the search path.
or pass the full path to aviread
aviread('c:\data\sample.avi')
Another thing you can if that is not the problem (if the folder containing sample.avi is on the path) is try:
[fid,msg] = fopen('sample.avi','r','l');
and see what is contained in msg