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

1 回表示 (過去 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 Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by