how can i prelocate arrays

1 回表示 (過去 30 日間)
Nihar  Patel
Nihar Patel 2019 年 9 月 18 日
回答済み: SaiDileep Kola 2019 年 9 月 23 日
  2 件のコメント
James Tursa
James Tursa 2019 年 9 月 19 日
編集済み: James Tursa 2019 年 9 月 19 日
Please edit your question and post your code as text formatted with the CODE button. We cannot copy & paste pictures into MATLAB to try out your code. My guess is that u is a variable and not a function, so using t(i) in the indexing may be the cause of the problem.
John D'Errico
John D'Errico 2019 年 9 月 19 日
Yes. I think you are correct. The obvious problem is if u is a variable, are the terms like (u(t(i) + pi)). t(i) + pi will never be an exact integer.

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

回答 (1 件)

SaiDileep Kola
SaiDileep Kola 2019 年 9 月 23 日
Pre allocating arrays may not solve your problem, as the error msg states you are indexing array ”u” using either negative integers or fractions, check if “t(i)-3” value turns out to be a negative or fraction.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by