Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
'Subscript indices must either be real positive integers or logicals... and they are.' Why the error?
조회 수: 2 (최근 30일)
이전 댓글 표시
I keep getting the following error when I try to plot to vectors of data and it doesn't make sense to me. Does anyone know why this is happening?
x =
1.0e+04 *
3.592304700000000
3.631143000000000
3.684712000000000
3.722212000000000
3.767748400000000
3.833372000000000
3.886942000000000
3.935166400000000
4.007484799999999
4.075794999999999
>> y
y =
2.052695376905927
2.116785788400099
2.203573844584633
2.266329782184324
2.342437651581077
2.450590377072377
2.538714605463729
2.628180700403267
2.745678639284237
2.865853118409325
>> isreal(x)
ans =
1
>> isreal(y)
ans =
1
>> plot(x,y)
Subscript indices must either be real positive integers or logicals.
댓글 수: 2
Brendan Hamm
2015년 7월 30일
Likely, you have a variable named plot in the workspace, so MATLAB thinks you are trying to index into the variable and not call the plot function. Therefore the error is about an index and not a function input.
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!