Array indices must be positive integers or logical values!
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sarah Abdellahi
le 9 Mai 2019
Commenté : Star Strider
le 9 Mai 2019
I have trained a regression model and now want to use it and get this error "Array indices must be positive integers or logical values". Here is the code
[RPMpred]=PredictRPM1sec(Tab_Pred_RPM(:,1:5));
and hereis my input array to the model
![Capture.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/218726/Capture.jpeg)
suggestions?
Thanks
Réponse acceptée
Star Strider
le 9 Mai 2019
‘suggestions?’
For one, post more of your code so the line you posted has a context.
I suspect that ‘PredictRPM1sec’ is an array, not a function, and if your ‘input array’ is what you posted in the image, those will be interpreted as subscript references. Note that none of them are integers, and some of them are negative.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!