How to compute a solution with a sum in matlab

1 visualizzazione (ultimi 30 giorni)
Xuefei Sun
Xuefei Sun il 23 Feb 2021
Risposto: Satwik il 4 Giu 2023
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

Risposte (1)

Satwik
Satwik il 4 Giu 2023
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'.

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by