Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentarios
Walter Roberson
Walter Roberson el 3 de Sept. de 2019
You created a vector named text instead of text being the name of a MATLAB plotting call.
Zeynab Mousavikhamene
Zeynab Mousavikhamene el 3 de Sept. de 2019
Great point @walter. I am not sure how I can press "accepted answer".

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Sept. de 2019
Editada: Walter Roberson el 3 de Sept. de 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.

Más respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 3 de Sept. de 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.

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by