Arrays have incompatible sizes for this operation
1 回表示 (過去 30 日間)
古いコメントを表示
Hey guys, thanks in advance.
Im trying to apply this equation on matlab

However i Keep getting this error , arrays have incompatible sizes for this operation, I dont understand since there are only constants and when there is a vector I do this .*
This is the code:
D is not getting any error, only H_BAC.
I ve attached the data
n=1;
u=2;
Lp=1;
fc=30e6;
c=3e8;
Vr=250;
D=sqrt(1-((u.^2*doppler_freqSurv.^2*c.^2)/4*Vr.^2*fc.^2));
H_BAC=exp(1*j*2*pi*((R1_matrix-Rm_matrix+n*Lp)/c*fc .*D));
0 件のコメント
回答 (1 件)
Voss
2022 年 7 月 12 日
R1_matrix and Rm_matrix are 1x400:
load R1_matrix
load Rm_matrix
whos R*
Therefore, the expression involving subtracting Rm_matrix from R1_matrix gives a 1x400 vector (here stored as the variable temp):
n=1;
u=2;
Lp=1;
fc=30e6;
c=3e8;
Vr=250;
temp = (R1_matrix-Rm_matrix+n*Lp)/c*fc;
whos temp
The result of that expression should be multiplied element-wise by D, but D is 1x8000:
load D
whos D
So you can't do it:
H_BAC=exp(1*j*2*pi*(temp.*D));
Hard to say what the right thing to do is with the information given.
8 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!