Home > Back-end >  Error using MATLAB matrix dimensions must be consistent
Error using MATLAB matrix dimensions must be consistent

Time:03-19

The function x=gauss (A, b)
N=length (b);
For k=1: n - 1
If A (k, k)==0
Fprintf (' error \ n, k);
return;
End
The index=k + 1: n.
M=-a (index, k)/A (k, k);
A (index, index)=A (index, index) + m * A (k, index);
B (index)=b (index) + m * b (k);

End
X=zeros (n, 1);
X (n)=b/A (n) (n, n);
For I=n - 1: - 1
X (I)=(b) (I) - A (I, [I + 1: n]) * x ([I + 1: n]))/A (I, I);
End

CodePudding user response:

Is the gaussian elimination method to solve linear equations for bosses to give directions
  • Related