How to compute a solution with a sum in matlab

1 回表示 (過去 30 日間)
Xuefei Sun
Xuefei Sun 2021 年 2 月 23 日
回答済み: Satwik 2023 年 6 月 4 日
My code is like this:
s=0;
for t=h:length(data);
s=s+data(t)*data(t-h)
end
And I need to find h to make s=0
  1 件のコメント
Kautuk Raj
Kautuk Raj 2023 年 6 月 3 日
Can you shed more details about your question?

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

回答 (1 件)

Satwik
Satwik 2023 年 6 月 4 日
s=0;
for h=1:length(data)
for t=h:length(data);
s=s+data(t)*data(t-h)
end
if(s==0)
disp(h);
end
end
Unrecognized function or variable 'data'.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by