How to fix array indices must be positive integers or logical values
2 ビュー (過去 30 日間)
古いコメントを表示
Samuel Pappalardo
2021 年 12 月 25 日
回答済み: Image Analyst
2021 年 12 月 25 日
%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 件のコメント
採用された回答
Walter Roberson
2021 年 12 月 25 日
編集済み: Walter Roberson
2021 年 12 月 25 日
[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
その他の回答 (1 件)
Image Analyst
2021 年 12 月 25 日
See the FAQ for a thorough discussion of that error plus more.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!