MATLAB: Matrix dimensions must agree error

matrix dimensions

I'm having matrix dimensions must agree error
Screen Shot 2019-10-29 at 10.47.36 PM.png

Best Answer

Well, tau is only two elements and w is a lot more than that, so you can't multiply them element-wise like you are attempting to do. Maybe you wanted to use tau(t) inside your for-loop instead of tau? And for plotting, maybe just x instead of x(w)?