Unable to perform assignment because the indices on the left side are not compatible with the size of the right side
1 回表示 (過去 30 日間)
古いコメントを表示
for jk=1:1:length(pliki)
tak=0;
p0=pliki(jk);
p00=char(p0);
pl0=(strcat(sciezka,pliki(jk)));
tab_plikow(jk)=pl0;
plik0=char(pl0);
Thats the part of old code i need to change but don't know how. tab_plikow has:"appears to change size on every loop iteration, consider preallocating". Was trying with zeroes for tab_plikow but it doesn't seems to work or I'm doing something wrong. Any help would be appreciated, thanks.
6 件のコメント
Marco Soto
2021 年 5 月 18 日
I had a problem just like me, it was solved: removing the global variables.
回答 (2 件)
Walter Roberson
2018 年 11 月 20 日
編集済み: Walter Roberson
2021 年 5 月 18 日
unless sciezka is empty then the result of the strcat will be a character vector of at least two char. You try to store the two char into a single numeric location .
Use cell arrays or string objects .
7 件のコメント
Walter Roberson
2018 年 12 月 4 日
The third parameter to audiowrite() is the the sample rate, fs, not the bits per sample.
info = audioinfo(plik0);
if isfield(info, 'BitsPerSample')
b = info.BitsPerSample;
else
b = nan;
end
Does your code still have
tab_plikow = zeros(length(pliki),1);
If it does then what does kown do ? Is it possibly a script that overwrites tab_plikow ?
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!