Unable to perform assignment because the indices on the left side are not compatible with the size of the right side
1 view (last 30 days)
Show older comments
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 Comments
Marco Soto
on 18 May 2021
I had a problem just like me, it was solved: removing the global variables.
Answers (2)
Walter Roberson
on 20 Nov 2018
Edited: Walter Roberson
on 18 May 2021
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 Comments
Walter Roberson
on 4 Dec 2018
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 ?
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!