Error:Subscript indices must either be real positive integers or logicals.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I get this error ,
Subscript indices must either be real positive integers or logicals. The line with this error is,
simout_diff=(simout_ps(t_plot,:,1))-(full_vehicle_data_cw(t_plot,:,1));
Please help me in resolving this error and what is meant by subscript indices?
댓글 수: 0
채택된 답변
Roger Stafford
2014년 1월 30일
편집: Roger Stafford
2014년 1월 30일
Matlab is telling you that 't_plot' is neither an integer greater than zero nor a logical variable. Since it is interpreted as an index to both the 'simout_ps' and 'full_vehicle_data_cw' arrays, this violates one of matlab's rules. In case you meant these to be functions rather than arrays, then for some reason matlab is not recognizing them as such.
댓글 수: 5
Image Analyst
2014년 1월 30일
Well there's your problem. See where you set the first element of t_plot to zero? Can't do that and have t_plot as an index into an array such as full_vehicle_data_cw.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!