Dot indexing is not supported for variables of this type.

1 回表示 (過去 30 日間)
Mohammad Junayed
Mohammad Junayed 2018 年 12 月 11 日
コメント済み: Walter Roberson 2018 年 12 月 11 日
i attached my code .. when i run my code .. there are some erros like , "Dot indexing is not supported for variables of this type. "
why is that ? Need help please ,

採用された回答

Walter Roberson
Walter Roberson 2018 年 12 月 11 日
You posted several hundreds of lines of code without including the input files and indication of what we should enter at the input() prompts . You also failed to include a complete copy of the error message so we do not know which line the message was on or which variables were involved . We can only make guesses as to the cause of the problem .
What I notice is that you use importdata and that in the btext case you use dot indexing of the result to access the textdata field. However importdata does not necessarily return a struct for txt files .
My recommendation is to never use importdata . The output it produces is too inconsistent .
  2 件のコメント
Mohammad Junayed
Mohammad Junayed 2018 年 12 月 11 日
problem is now, "Index in position 1 is invalid. Array indices must be positive integers or logical values."
WeChat Image_20181211155614.png
Walter Roberson
Walter Roberson 2018 年 12 月 11 日
Your x is empty. length(x) is 0 so mod(length(x),2)==0 is true. x(end-1,1) is then x(0-1,1) which is x(-1,1) which is not valid indexing .

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by