Dot indexing is not supported for variables of this type???

1 visualización (últimos 30 días)
sagun subedi
sagun subedi el 24 de Sept. de 2020
Respondida: the cyclist el 25 de Sept. de 2020
for i = 1: n
distance(i) = sqrt((sink(1)-site(i, 1)).^2+ (sink(2)-site(i,2)).^2);
Etx(i) = bit * (b + g * distance(i).^2);
E(i) = E0 - Etx(i);
for rr = 2: 10
count = 1;
%slope(i) = (centers(2)-site(i,2))/(centers(1)-site(i,1));
format long;
E(i).tx(rr) = E(i)-E(i).tx(rr-1);
if E(i).tr(rr) <= 90/100*E0
count = count+1
rr;
end
end
end
Why is output "Dot indexing is not supported for variables of this type."?
  5 comentarios
sagun subedi
sagun subedi el 25 de Sept. de 2020
E(i).tx(rr) = E(i)-E(i).tx(rr-1);
This is the line where i get error.
The expected output is also a numeric variable.
Sindar
Sindar el 25 de Sept. de 2020
Editada: Sindar el 25 de Sept. de 2020
So, let's say E is:
[1 2 3]
How does anything called 'tx' come into play?
Etx is an entirely separate variable. Is it possible you mean something like this?
Etx(i) = E(i)-Etx(i);

Iniciar sesión para comentar.

Respuestas (1)

the cyclist
the cyclist el 25 de Sept. de 2020
Complete guess here. Are you simply trying to multiply the two variables? If so, then
E(i).*tx(rr-1)
Just using a dot, by itself, is a syntax with a different use.

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