不知道为什么报这样的错:Attempted to access e(10,:); index out of bounds
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/09 14:08:33
不知道为什么报这样的错:Attempted to access e(10,:); index out of bounds because size(e)=[0,256]
fid=fopen('test1.txt','rt'); %打开文件
y=fscanf(fid,'%f'); %读数据
e=fra(256,128,y); %对y分帧,帧长256,帧移128
ee=e(10,:); %选取第10帧
subplot(211) %画第一个子图
ee1=ee/max(ee); %幅值归一化
plot(ee1) %画波形
xlabel('样点数') %横坐标名称
ylabel('幅度') %纵坐标名称
title ('原始语音') %文字标注
axis([0,256,-1.5,1.5]) %限定横纵坐标范围
% 矩形窗傅立叶变换
r=fft(ee,1024); %对信号ee进行1024点傅立叶变换
r1=abs(r); %对r取绝对值 r1表示频谱的幅度值
r1=r1/max(r1); %幅值归一化
yuanlai=20*log10(r1); %对归一化幅值取对数
signal(1:256)=yuanlai(1:256); %取256个点,目的是画图的时候,维数一致
pinlv=(0:1:255)*8000/512; %点和频率的对应关系
subplot(212) %画第二个子图
plot(pinlv,signal); %画幅值特性图
xlabel('f/Hz') %横坐标名称
ylabel('对数幅度/dB') %纵坐标名称
title ('加矩形窗时语音谱') %文字标注
axis([0,4000,-80,15]) %限定横纵坐标范围
fid=fopen('test1.txt','rt'); %打开文件
y=fscanf(fid,'%f'); %读数据
e=fra(256,128,y); %对y分帧,帧长256,帧移128
ee=e(10,:); %选取第10帧
subplot(211) %画第一个子图
ee1=ee/max(ee); %幅值归一化
plot(ee1) %画波形
xlabel('样点数') %横坐标名称
ylabel('幅度') %纵坐标名称
title ('原始语音') %文字标注
axis([0,256,-1.5,1.5]) %限定横纵坐标范围
% 矩形窗傅立叶变换
r=fft(ee,1024); %对信号ee进行1024点傅立叶变换
r1=abs(r); %对r取绝对值 r1表示频谱的幅度值
r1=r1/max(r1); %幅值归一化
yuanlai=20*log10(r1); %对归一化幅值取对数
signal(1:256)=yuanlai(1:256); %取256个点,目的是画图的时候,维数一致
pinlv=(0:1:255)*8000/512; %点和频率的对应关系
subplot(212) %画第二个子图
plot(pinlv,signal); %画幅值特性图
xlabel('f/Hz') %横坐标名称
ylabel('对数幅度/dB') %纵坐标名称
title ('加矩形窗时语音谱') %文字标注
axis([0,4000,-80,15]) %限定横纵坐标范围
ee=e(10,:); %选取第10帧
长度不够,数组越界
十大低级错误之首
长度不够,数组越界
十大低级错误之首
不知道为什么报这样的错:Attempted to access e(10,:); index out of bounds
在MATLAB中,提示Attempted to access th(2,1); index out of bounds
Matlab新手,Attempted to access X(2); index out of bounds becau
matlab Attempted to access x(2); index out of bounds because
matlab中出现 Attempted to access X(1); index out of bounds beca
matlab问题 Attempted to access w(1001); index out of bounds be
Attempted to access a(:,2); index out of bounds because size
运行Matlab时出现错误?Attempted to access rxd(500); index out of bou
Matlab 报错为Attempted to access f(64.4); index must be a posit
matlab运行出现问题,Attempted to access e(1,0); index must be a pos
请问“list index out of bounds”是什么意思?
List index out of bounds什么意思?