defferentiate1.m

来自「基于Matlab编写的用于对数据进行插值分析和傅立叶变换的程序」· M 代码 · 共 40 行

M
40
字号
clear
clc
load D095d1.txt
R=D095d1(:,2);
B=D095d1(:,1);

figure
subplot(311);
plot(B,R,'r.');

n=16
dim=2^n;
inc=(10-0.11)/(2^n-1);

Bf=0.11:inc:10;

t=interp1(1./B,R,Bf);
offset=sum(t)/dim;
f=fft(t-offset,dim)/dim;
f2=abs(f(1:dim/2));

subplot(312)
plot(Bf,t);
xlabel('1/B(1/T):time');
ylabel('R(arb. units)');

nf=0:dim-1;
incf=1/inc/(dim-1);
freq=incf*nf(1:dim/2);
subplot(313)
plot(freq,f2,'r-');
axis([0 100 -0.5 6])
xlabel('Freq');
ylabel('Intensity (arb. units)');

%out put
y = [Bf; t];
fid = fopen('Bft.dat','w');
fprintf(fid,'%20.10f  %20.10f\n',y);
fclose(fid);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?