- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
I have written the following code in matlab:
I get the following warning message:
[m]
? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> uexact at 3
v=sin(2*pi*x)*exp(-4*pi^2*t);
Error in ==> test3 at 11
ex=uexact(x,t);
[/m]Could you tell me where my mistake is? (Thinking)
I have written the following code in matlab:
Code:
function v=uexact(x,t)
v=sin(2*pi*x)*exp(-4*pi^2*t);
end
function [ex]=test3
h = 1/50;
T=1/2500;
x=0:h:1;
t=0:T:1;
ex=uexact(x,t);
end
[m]
? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> uexact at 3
v=sin(2*pi*x)*exp(-4*pi^2*t);
Error in ==> test3 at 11
ex=uexact(x,t);
[/m]Could you tell me where my mistake is? (Thinking)