我现在也正在做这个,你看看这个程序,是从书上弄的。。
%频域积分
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
clc
close all hidden
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fni=input(‘频域积分-输入数据文件名:’,’s’);
fid=fopen(fni,’r’);
sf=fscanf(fid,’%f’,1); %采样频率
fmin=fscanf(fid,’%f’,1); %最小截止频率
fmax=fscanf(fid,’%f’,1); %最大截止频率
c=fscanf(fid,’%f’,1); %单位变换系数
it=fscanf(fid,’%f’,1); %积分次数
sx=fscanf(fid,’%s’,1); %横向坐标轴的标注
sy1=fscanf(fid,’%s’,1); %纵向坐标轴输入单位的标注
sy2=fscanf(fid,’%s’,1); %纵向坐标轴输出单位的标注
fno=fscanf(fid,’%s’,1); %输出数据文件名
x=fscanf(fid,’%f’,[1,inf]); %输入数据存成行向量
status=fc