Matrix dimensions must agree.

조회 수: 1 (최근 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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by