The end operator must be used within an array index expression
Ältere Kommentare anzeigen
My output is showing "The end operator must be used within an array index expression." when I try to run this:
%15. split spectograms of background noise between the training, validation, and test sets
numTrainBkg = floor(0.85*numBkgClips);
numValidationBkg = floor(0.15*numBkgClips);
XTrain(:,:,:,end+1:end+numTrainBkg) = Xbkg(:,:,:,1:numTrainBkg);
YTrain(end+1:end+numTrainBkg) = "background";
XValidation(:,:,:,end+1:end+numValidationBkg) = Xbkg(:,:,:,numTrainBkg+1:end);
YValidation(end+1:end+numValidationBkg) = "background";
Please help me solve this..
6 Kommentare
Stephen23
am 21 Jan. 2022
@Sharena Natasha Nor Hisham: please show us the complete error message. This means all of the red text.
Sharena Natasha Nor Hisham
am 21 Jan. 2022
Bearbeitet: Sharena Natasha Nor Hisham
am 21 Jan. 2022
Please run the following command from within the scope where these variables are defined (i.e., I don't know if this is in a function or a script; if it's a function put this line in the function after where the variables are defined and before where the error happens; if it's a script you can just run this line on the MATLAB command prompt):
whos XTrain YTrain XValidation YValidation Xbkg
and show the output. This will tell us what type of variables these are. It seems like at least one of them is not an array.
Sharena Natasha Nor Hisham
am 22 Jan. 2022
Bearbeitet: Sharena Natasha Nor Hisham
am 22 Jan. 2022
Sharena Natasha Nor Hisham
am 22 Jan. 2022
Cris LaPierre
am 22 Jan. 2022
Please create a new question for this as it is unrelated.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Speech Recognition finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!