필터 지우기
필터 지우기

Array indices must be positive integers or logical values!

조회 수: 2 (최근 30일)
sarah Abdellahi
sarah Abdellahi 2019년 5월 9일
댓글: Star Strider 2019년 5월 9일
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
suggestions?
Thanks
  댓글 수: 2
Stephen23
Stephen23 2019년 5월 9일
@sarah Abdellahi: please show us the complete error message. This means all of the red text.
sarah Abdellahi
sarah Abdellahi 2019년 5월 9일
Thats the complete error message. Here is a photo
Capture.JPG

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2019년 5월 9일
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
sarah Abdellahi
sarah Abdellahi 2019년 5월 9일
YUP, had a typo in my code. your suggestion helpmed me find it.
Thanks
Star Strider
Star Strider 2019년 5월 9일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by