Array indices must be positive integers or logical values.

Why do i have this problem? Array indices must be positive integers or logical values.
Here is my code.
Thanks!

回答 (2 件)

Torsten
Torsten 2023 年 4 月 2 日
編集済み: Torsten 2023 年 4 月 2 日

0 投票

H(0) does not exist in MATLAB. Array indices start with 1.
And if inv(K-W^2*M) is a matrix, you cannot save it in a scalar H(W). You will have to use a cell array:
H{W} = inv(K-W^2*M)
Image Analyst
Image Analyst 2023 年 4 月 4 日
編集済み: Image Analyst 2023 年 4 月 4 日

0 投票

Try
for W = 0 : 500
H{W + 1} = inv(K-W^2*M);
end
See the FAQ for a thorough discussion:

カテゴリ

ヘルプ センター および File ExchangeGeometric Transformation and Image Registration についてさらに検索

タグ

質問済み:

2023 年 4 月 2 日

編集済み:

2023 年 4 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by