Home > Back-end >  Matlab running error error use * internal matrix dimensions must be consistent.
Matlab running error error use * internal matrix dimensions must be consistent.

Time:09-24

CLC
Close all
Clear all
M=16;
K=log2 (M);
N=10000; % data length every time
The % u=0.05;
U=0.001;
M=50; % test times
% h=0.088 [0.05 0.063]; % 0.126]; 0.25];
% h=[1, 0.3 to 0.3, 0.1 to 0.1];
Hr=[0.005 0.009 0.024 0.854 0.218 0.049 to 0.016];
Hi=[0.004 0.03 0.104 0.52 0.273 0.074 0.020];
H=hr + j * hi;
L=7;
SNR=20;
Mse_av=zeros (1, n - L + 1);
Isi_av=zeros (1, n - L + 1);
For jj=1: m
A=randint (1, n, M);
A1=qammod (a, M);

Mr1=real (a1). ^ 4.
Mr2=real (a1). ^ 2;
Mi1=imag (a1). ^ 4.
Mi2=imag (a1). ^ 2;

Rr1=mean (mr1);
Rr2=mean (mr2);

Ri1=mean (mi1);
Ri2=mean (mi2);

Rr=rr1/rr2;
Ri=/ri1 ri2;
% R2=SQRT (2);

S=filter (h, 1, a1);

X=awgn (s, SNR, "measured");
W=[1 0 0 0 0 0 0];
For I=1: n - L + 1
Y=x (I + L - 1:1: I);
Conj z (I)=w * (y) ';
Er=(Rr - (real (z (I)) ^ 2)) * real (z (I));
Ei=(Ri - (imag (z (I)) ^ 2)) * imag (z (I));
The % u=0.0005 * (1 - (1/SQRT (2 * PI * (exp (50 * (- e ^ 2/2)))));
The % u=0.0005 * (1 - (exp (- 50 * e ^ 2)));
The % u=e * (1 - exp (5 * e ^ 2));
E=er + 1 j * ei;

X1=conv (h, w);
Sum_x1=sum (abs (x1). ^ 2);
Isi (I)=(sum_x1 - Max (abs (x1). ^ 2))/Max (abs (x1). ^ 2);

W=w + u * * e conj (y)/(y * y ');
Mse (I)=abs (e) ^ 2;
end;
Isi_av=isi_av + (isi);
Mse_av=mse_av + mse;
U=u + 0.5 * 0.0028 * * 20 log10 (mse_av)
end;
Isi_av=isi_av/m;
Mse_av=mse_av/m;
Scatterplot (a1, 1, 0, 'g *');
The title (' original without noise modulation signal constellation diagram)
Hold on
Scatterplot (x, 1, 0, 'g *');
The title (' noise modulation signal constellation graph)
Hold on
Scatterplot (z (n - 2200 - n - 200), 1, 0, 'g *');
The title (' equilibrium after the constellation diagram)
Hold on
Figure (4)
Hold on
The plot ((1: n - L + 1), 20 * log10 (mse_av), 'g')
The title (' minimum mean square error)
Figure (5)
Hold on
The plot ((1: n - L + 1), 20 * log10 (isi), 'g')
The title (' ISI)

CodePudding user response:

Used matlab
But the matrix multiplication
It should be
A [n] [j] * b [j] [m]
That is, the number of columns to a b is equal to the number of rows, because I don't understand the matlab, so don't know your matrix is in line with the requirements,
  • Related