How to fix array indices must be positive integers or logical values
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Samuel Pappalardo
el 25 de Dic. de 2021
Respondida: Image Analyst
el 25 de Dic. de 2021
%I'm trying to read a wav file and plot in the time domain
[y,fs] = audioread('Samuel_Pappalardo.wav')
t = linespace (0,length(y)/fs, length(y));
figure;
plot(t,y);
0 comentarios
Respuesta aceptada
Walter Roberson
el 25 de Dic. de 2021
Editada: Walter Roberson
el 25 de Dic. de 2021
[y,fs] = audioread('Samuel_Pappalardo.wav')
t = (0:size(y,1)-1)/fs;
figure;
plot(t, y);
The above repairs a boundary condition in your time calculation.
It does not, however, repair any index problem. If you encountered an index problem it implies that you had an existing variable named plot or linspace or length
Más respuestas (1)
Image Analyst
el 25 de Dic. de 2021
See the FAQ for a thorough discussion of that error plus more.
0 comentarios
Ver también
Categorías
Más información sobre Pulsed Waveforms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!