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

1 vue (au cours des 30 derniers jours)
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 3 Sep 2019
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 commentaires
Walter Roberson
Walter Roberson le 3 Sep 2019
You created a vector named text instead of text being the name of a MATLAB plotting call.
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 3 Sep 2019
Great point @walter. I am not sure how I can press "accepted answer".

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Sep 2019
Modifié(e) : Walter Roberson le 3 Sep 2019
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.

Plus de réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 3 Sep 2019
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 commentaire
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 3 Sep 2019
Actually I ran these two lines before and they only show one value.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by