Matrix dimensions must agree.

3 ビュー (過去 30 日間)
vincenzo violi
vincenzo violi 2020 年 12 月 6 日
コメント済み: vincenzo violi 2020 年 12 月 6 日
Hello , I am new on Matlab and I am trying to find out what's going on here.
Basically the error is :
Matrix dimensions must agree.
Error in EdgeExe2 (line 54)
Tup(k)=Dn/W.*log(1+((Pr.*h)/sigma2)+(Texe));
Could someone help me to find out the reason? Really thanks
for k = 1:length(d1range)
d1 = d1range(k);
L= zeros(length(d1range));
Tupload = zeros(length(d1range));
L(k,:)=((lambda)./(4*pi*(d1range))).^2; %PATH-LOSS
Pr=Pt_w*Gt*Gr*L;
taps=10;
h=randn(1,taps)+j*randn(1,taps);
Tup(k)=Dn/W.*log(1+((Pr.*h)/sigma2)+(Texe));
Tupload(k,:) = Tup(k);
end

採用された回答

Setsuna Yuuki.
Setsuna Yuuki. 2020 年 12 月 6 日
編集済み: Setsuna Yuuki. 2020 年 12 月 6 日
The arrays dimensions are differents
Dn/W.*log(1+((Pr.*h)/sigma2)+(Texe)) %Is a 10x10 complex matrix
If you use
Tup(k) %You are storing a variable
  3 件のコメント
Setsuna Yuuki.
Setsuna Yuuki. 2020 年 12 月 6 日
You can use Tup{k}. But it depend on what you need from this array
Tup{k}=Dn/W.*log(1+((Pr.*h)/sigma2)+(Texe));
Tupload = Tup{1,k};
vincenzo violi
vincenzo violi 2020 年 12 月 6 日
I need to calculate this values and plot it. It's about latency calculation according distances variation. But I am stucked before the plot.
Unfortunatelly neither your solution actually really works. Matlab gives me back always same mistake. Anyway thanks the some for your time.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by