The end operator must be used within an array index expression
Mostrar comentarios más antiguos
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 comentarios
Stephen23
el 21 de En. de 2022
@Sharena Natasha Nor Hisham: please show us the complete error message. This means all of the red text.
Sharena Natasha Nor Hisham
el 21 de En. de 2022
Editada: Sharena Natasha Nor Hisham
el 21 de En. de 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
el 22 de En. de 2022
Editada: Sharena Natasha Nor Hisham
el 22 de En. de 2022
Sharena Natasha Nor Hisham
el 22 de En. de 2022
Cris LaPierre
el 22 de En. de 2022
Please create a new question for this as it is unrelated.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Speech Recognition en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!