I have this code and I keep getiing this error "Matrix dimensions must agree.", please let me know how to fix it, thanks!!
I can not post the full code because its a project Im working on for class, but this line is where the issue is
ue = 1-2.*cos((3.*pi.*x)./(2.*L)).*exp(((9.*(pi.^2).*alpha)/(2.*L)).*-t)+4.*cos((15.*pi.*x)/(2.*L)).*exp(((9.*(pi.^2).*alpha)./(2.*L)).*-t);
x and t are defined as:
x = linspace(0,L,nx);
t = linspace(0,tmax,nt);
tmax, nt,nx, and L are just constant variables.