inputtolomb.m
来自「这是利用MATLAB做L-S谱分析的程序」· M 代码 · 共 22 行
M
22 行
function indata = inputtolomb
%CREATE TEST DATA FOR lombscargle.m
%Create time points
t=[0:pi/32:8*pi];
%Keep random time points, discard the rest
%Note: To increase the number of points retained, decrease the multiplier (and vice versa)
discpct = 30; %Percent of data points to discard
ndiscards = floor((discpct/100)*length(t));
keeps = randperm(length(t));
keeps = sort(keeps(ndiscards+1:end)); %Discard 25% of the samples, selected randomly
t=t(keeps);
%USER-SPECIFIED FREQUENCIES AND AMPLITUDES (for testing purposes)
%Frequencies (Hz) = [0.9 3.3 4.0 4.5]
%Amplitudes = [2.0 1.8 3.0 1.5]
foft = 2.0*sin(2*pi*0.9*t) + 1.8*sin(2*pi*3.3*t) + 3.0*sin(2*pi*4*t) + 1.5*sin(2*pi*4.5*t);
indata=[t' foft'];
%lombscargle(indata);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?