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
https://www.mathworks.com/help/matlab/ref/polyval.html
This is probably what you should be doing,
pas = polyfit(cat,dog,1);
dog_fit = polyval(pas, cat);