Error in App Designer with Slider: 'Index Exceeds Array Bounds'

1 回表示 (過去 30 日間)
Emma Peek
Emma Peek 2019 年 4 月 12 日
コメント済み: Emma Peek 2019 年 4 月 12 日
Hi- I have been trying to create an app that will plot one column of a table I have loaded in App Designer using a slider. Each x value corresponds to a cell, and each y value corresponds to a characteristic about that cell. I am hoping to use the slider to specify individual cells to plot one at a time. However, every time I try to plot it using the slider, I get the same error: Index Exceeds Array Bounds. I am not sure what I am doing wrong.

採用された回答

TADA
TADA 2019 年 4 月 12 日
without the full code it's hard to say, and in general uploading screenshots of your code is not very helpful.
Still, the problem is most likely because you're trying to index that array (what ever it is) with a character:
x = 1:10;
x('4');
Index exceeds matrix dimensions.
to understand the root of this error, you need to understand indexing and type conversions
what you did is to index the array with the character 4 which is converted to a number before indexing:
i = double('4')
i =
52
I guess that the array you are trying to index has less than 52 items, and thats were the error comes from
  1 件のコメント
Emma Peek
Emma Peek 2019 年 4 月 12 日
Thank you for your help - that makes sense. Sorry about the screenshots.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by