フィルターのクリア

Index exceeds the number of array elements (2).Please help ?

1 回表示 (過去 30 日間)
S Priya
S Priya 2021 年 6 月 29 日
コメント済み: S Priya 2021 年 6 月 29 日
h=1;
Ha=[-0.5;0.5]*h;
for i=1
h1=Ha('1,i');h2=Ha('2,i');
hnl=h2-h1;
end

採用された回答

KSSV
KSSV 2021 年 6 月 29 日
編集済み: KSSV 2021 年 6 月 29 日
Check your syntax. Indexing should be integers not strings. When you use ' ', this will be a string.
h=1;
Ha=[-0.5;0.5]*h;
for i=1
h1=Ha(1,i);
h2=Ha(2,i);
hnl=h2-h1;
end
  2 件のコメント
Rik
Rik 2021 年 6 月 29 日
I still dislike the choice Mathworks made when picking the name for the string datatype. The documentation is still littered with mentions of 'string' where they mean char array instead. When there wasn't a string datatype there wasn't any confusion.
In short, I have a meaningless correction for this answer: single quotes create a char, not a string.
S Priya
S Priya 2021 年 6 月 29 日
Thank you.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by