Home > Blockchain >  Not a single RHS dimension problem of matlab for elder people know check it
Not a single RHS dimension problem of matlab for elder people know check it

Time:09-24

The main program, an error is (x:, I + 1) the way, don't know how to change,
The function/x, t=LONGE1 (x0, t0, a, b, h)
N=(b - a)/h;
X (1)=x0;
T (1)=t0;
For I=1: n
K1=fun (x (I), t (I));
K2=fun (x (I) + h/2 x K1, t (I) + h/2);
K3=fun (x (I) + h/2 * K2, t (I) + h/2);
K4=fun (x (I) + h * K3, t (I) + h);
X (:, I + 1)=x (: I) + h * (K1 + 2 * K2 + 2 * K3, K4)/6.
T (I + 1)=t (I) + h;
End

End
Function subroutine below
The function z=fun (x, t)
Ss=[- 10-100 0 0; 1 0 0 0, 0, 0-5-25; 0 0 0, 1].
F=10;
Z=ss * x + F * sin (10 * t);
Is the function in a matrix cannot be carried out
  • Related