【发布时间】:2014-10-03 14:25:34
【问题描述】:
我有一个已知信号x,我想每隔 10 秒分析一次:
t = 1:1:100; %time
x = 8*sin(t); %the signal
a1= 5; %known coefficient for the first 10s
对于这个信号,我对前 10 秒进行了第一次分析:
%analysis 1
x1 = x(1:11);
y1 = x1*a1;
y_mean1 = mean(y1);
a2=y_mean1; %coefficient necessary for the next 10s
现在我对接下来的 10 秒进行分析:
%analysis 2
x2 = x(12:22);
y2 = x2*a2;
y_mean2 = mean(y2);
a3 = y_mean2; %coefficient necessary for the next 10s
这将在信号的总长度上重复。但是,这种方法并不是我想象的最方便的。如何进入循环?
谢谢!
【问题讨论】:
-
注意
1:11其实是11秒...