because I have the error ¡Subscript indices must either be real positive integers or logicals!

조회 수: 2 (최근 30일)
Hi I am making a program to get the average of voices stored in a database.
clear all;
clc;
Fs = 22050; % Frecuencia de Muestreo
[rec1] = wavread('F1b.wav');
[rec2] = wavread('F2b.wav');
[rec3] = wavread('F3b.wav');
[rec4] = wavread('F4b.wav');
[rec5] = wavread('F5b.wav');
prom=rec1;
tam = length(rec5);
fori = 1:1:tam
prom(i) = ((rec1(i)+rec2(i)+rec3(i)+rec4(i)+rec5(i))/5);
end;
lon = length(prom);
d = max(abs(prom));
prom = prom/d;
wavwrite(prom,Fs,16,'FProm.wav')
plot(prom)
sound(prom,Fs)
but when I compile throws the aforementioned mistake
thank you very much.

채택된 답변

Walter Roberson
Walter Roberson 2016년 6월 3일
fori = 1:1:tam
is not a for loop: it is an assignment to a variable named fori

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by