# Matrix dimensions must agree.

1 visualización (últimos 30 días)
vincenzo violi el 6 de Dic. de 2020
Comentada: vincenzo violi el 6 de Dic. de 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));
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));
end
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Setsuna Yuuki. el 6 de Dic. de 2020
Editada: Setsuna Yuuki. el 6 de Dic. de 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 comentariosMostrar 1 comentario más antiguoOcultar 1 comentario más antiguo
Setsuna Yuuki. el 6 de Dic. de 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));
vincenzo violi el 6 de Dic. de 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.

Iniciar sesión para comentar.

### Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by