尝试在同一轨迹内生成具有多个不同幅度历元的正弦函数。
例如,2Hz 正弦波以幅度 1 持续 10 秒,幅度 10 持续 10 秒,然后再回到幅度 1 持续 10 秒。
我尝试在这里编辑示例:http: //www.mathworks.se/help/slcontrol/ug/frest.sinestream.html 但代码出错:
input = frest.Sinestream('Frequency',[2 2 2],...
'Amplitude',[1 10 1],...
'FreqUnits','Hz',...
'SamplesPerPeriod',[40 40 40],...
'RampPeriods',[0 0 0],...
'SettlingPeriods',[1 1 1]);
plot(input)
从中收到的错误是:
Error using frest.Sinestream/set.Frequency (line 127)
The "Frequency" parameter of a sinestream signal should be a double vector consisting of unique values.
Error in frest.Sinestream/initializeParams (line 508)
obj.(varargin{2*ct-1}) = varargin{2*ct};
Error in frest.Sinestream (line 80)
obj = initializeParams(obj,inputparams{:});
Error in sine (line 1)
input = frest.Sinestream('Frequency',[2 2 2],...