why do I get the error Subscript indices must either be real positive integers or logicals?

hello, I get this error "Subscript indices must either be real positive integers or logicals." in following line of code:
HH(:,:,(ss-1)*NR+rr)=squeeze(Hf(rr-1,ss-1,:,:));
although the indices remain positive i.e. rr and ss vary from 1:2. any help??

 採用された回答

Amir
Amir 2014 年 8 月 15 日
I am not sure 100% as I couldn't guess your data. But if your rr and ss is 1:2 so Hf(rr-1,ss-1,:,:) is: Hf([0 1], [0 1] , :,:). Therefore your index is not positive (it has zero indexing).
I hope this helps you. If not please give a bit more information about your matrix.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

タグ

質問済み:

2014 年 8 月 15 日

コメント済み:

2014 年 8 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by