The graph is empty, how can i solve this

1 回表示 (過去 30 日間)
Imane Zemmouri
Imane Zemmouri 2023 年 8 月 14 日
コメント済み: Imane Zemmouri 2023 年 8 月 15 日
The graph is empty
What's the reason?

採用された回答

Florian Bidaud
Florian Bidaud 2023 年 8 月 14 日
編集済み: Florian Bidaud 2023 年 8 月 14 日
This is because you use h in your for loop making it a single numerical value (=n). Replace h in the for loop with another name like i and that should work:
I guess what you want to do is use the values of h ? Then you will have to do that :
Iterating h for 2 to n was not taking the values in h vectors, but just replacing h with values for 2 to n. You have to iterate i and then use h(i)
for i = 2:n
%W1(h(i)) = I * (.5 * A1 * [W1(h-1); W2(h-1)] + .5 * C1 * U);
%W2(h(i)) = J * (.5 * A1 * [W1(h-1); W2(h-1)] + .5 * C1 * U);
indplus = indpositive(h(i));
W = (.5 * A1 * W +(indplus+.5*(1-indplus)) * C1 * U);
covariance = [covariance, K * W];
end
  1 件のコメント
Imane Zemmouri
Imane Zemmouri 2023 年 8 月 15 日
Thank you very much.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by