The end operator must be used within an array index expression
Afficher commentaires plus anciens
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 commentaires
Stephen23
le 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
le 21 Jan 2022
Modifié(e) : Sharena Natasha Nor Hisham
le 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
le 22 Jan 2022
Modifié(e) : Sharena Natasha Nor Hisham
le 22 Jan 2022
Sharena Natasha Nor Hisham
le 22 Jan 2022
Cris LaPierre
le 22 Jan 2022
Please create a new question for this as it is unrelated.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!