필터 지우기
필터 지우기

Index in position 1 exceeds array bounds (must not exceed 1).

조회 수: 1 (최근 30일)
Index in position 1 exceeds array bounds (must not exceed 1).
Error in jsondecode_v1 (line 257)
text(total_cellcount.time(find(isinf(ratio_mig_rim_cor))),(max(ratio_mig_rim_cor(~isinf(ratio_mig_rim_cor))-1)),'0
cell in core')
I tried running these:
>> total_cellcount.time(find(isinf(ratio_mig_rim_cor)))
>> max(ratio_mig_rim_cor(~isinf(ratio_mig_rim_cor))-1))
and each return one value.
I am trying to add a text at specific location in a figure and I get above error. Any suggestion?
Update:
I tried this: text(2,2,'0 cell in core')
I just gave static positions and I got the same error.
Index in position 1 exceeds array bounds (must not exceed 1).
Error in jsondecode_v1 (line 257)
text(2,2,'0 cell in core')
  댓글 수: 7
Walter Roberson
Walter Roberson 2019년 9월 3일
You created a vector named text instead of text being the name of a MATLAB plotting call.
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019년 9월 3일
Great point @walter. I am not sure how I can press "accepted answer".

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

채택된 답변

Walter Roberson
Walter Roberson 2019년 9월 3일
편집: Walter Roberson 2019년 9월 3일
You created a row vector named text instead of text being the name of a MATLAB plotting call.
... and then you access that row vector as if it were a 3D array, which is why you get the indexing error.

추가 답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 9월 3일
Hi,
In your command to display the string: '0 cell in core'
One of your set logical indexes ( total_cellcount.time(find(isinf(ratio_mig_rim_cor))), (max(ratio_mig_rim_cor(~isinf(ratio_mig_rim_cor))-1))) has more than one value.
You can check this issue by running these commands:
>> total_cellcount.time(find(isinf(ratio_mig_rim_cor)))
>> max(ratio_mig_rim_cor(~isinf(ratio_mig_rim_cor))-1))
These should show how many values are obtained from each of your assigned x and y for your string display position.
Good luck.
  댓글 수: 1
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019년 9월 3일
Actually I ran these two lines before and they only show one value.

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

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by