polyfit requires x , y to be vectors. Also, it makes no sense to fit a single value.
It seems to me that your usage of polyval is wrong. Take a look at the docs
This is probably what you should be doing,
pas = polyfit(cat,dog,1);
dog_fit = polyval(pas, cat);