Thanks for all incoming messages:)The problem was with Matlab 6.5. I think there is a bug with thisversion of Matlab. I am just writing to log this detail.