max(dg) returns "Subscript indices must either be real positive integers or logicals."
조회 수: 2 (최근 30일)
이전 댓글 표시
Any reasons why? dg is an n x 1 column vector.
댓글 수: 0
답변 (1개)
John D'Errico
2017년 11월 25일
Simple. Don't create a variable named max. How should MATLAB know if you do that, that then when you try to use the FUNCTION named max, what you really want to do? MATLAB assumes that you know what you are doing.
So when you created a variable max, then used the form max(dg), MATLAB assumes that you knew what you were doing, that you did this for a good reason. It then tries to index the variable max, using dg as an index.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!