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

1 vue (au cours des 30 derniers jours)
sagun subedi
sagun subedi le 24 Sep 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 commentaires
sagun subedi
sagun subedi le 25 Sep 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 le 25 Sep 2020
Modifié(e) : Sindar le 25 Sep 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);

Connectez-vous pour commenter.

Réponses (1)

the cyclist
the cyclist le 25 Sep 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.

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by