
要素数は足りてるはずなのに「行列のインデックスは削除の範囲外です。」のエラーが出る。
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MATLABのApp Designerを使用しています。
i2cボードの変数の配列と、アドレス情報の配列を作成していて、アドレス情報をボードに入れようとしています。
以下のコードで、forループで4回目までは入っていくのですが、5回目(num = 5)の時に、
BoardAll(num)= [];の部分で、

「行列のインデックスは削除の範囲外です。」
のエラーが出ます。
BoardAll(num)の要素数はnumelで8個となっているので、5回目のループでエラーになる理由がわかりませんでした😓
properties (Access = private)
abc1,
abc2,
def1,
def2,
def3,
ghi1,
ghi2,
ghi3,
end
▼コールバック関数内
BoardAll = {app.abc1,app.abc2,app.def1,app.def2,app.def3,app.ghi1,app.ghi2,app.ghi3};
PrepI2c = {'0x10','0x11','0x12','0x40','0x41','0x42','0x60','0x61'};
for num = 1:numel(BoardAll)
BoardAll(num)= [];
BoardAll(num) = PrepI2c(num);
disp(BoardAll(num));
end
原因がわかる方いらっしゃいましたら、ご教示いただけますと幸いです。
お忙しいところすみませんが、どうぞよろしくお願いいたします。
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!