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

1 view (last 30 days)
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 Comments
sagun subedi
sagun subedi on 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 on 25 Sep 2020
Edited: Sindar on 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);

Sign in to comment.

Answers (1)

the cyclist
the cyclist on 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.

Community Treasure Hunt

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

Start Hunting!