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

1 回表示 (過去 30 日間)
sagun subedi
sagun subedi 2020 年 9 月 24 日
回答済み: the cyclist 2020 年 9 月 25 日
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 件のコメント
sagun subedi
sagun subedi 2020 年 9 月 25 日
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 2020 年 9 月 25 日
編集済み: Sindar 2020 年 9 月 25 日
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);

サインインしてコメントする。

回答 (1 件)

the cyclist
the cyclist 2020 年 9 月 25 日
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.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by