Matrix dimensions must agree.

3 Ansichten (letzte 30 Tage)
vincenzo violi
vincenzo violi am 6 Dez. 2020
Kommentiert: vincenzo violi am 6 Dez. 2020
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

Akzeptierte Antwort

Setsuna Yuuki.
Setsuna Yuuki. am 6 Dez. 2020
Bearbeitet: Setsuna Yuuki. am 6 Dez. 2020
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 Kommentare
Setsuna Yuuki.
Setsuna Yuuki. am 6 Dez. 2020
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 am 6 Dez. 2020
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by