How to compute a solution with a sum in matlab

1 次查看(过去 30 天)
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 个)

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 CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by