位置 1 のインデックスが無効です。配列インデックスは正の整数または logical 値でなければなりません。
Ältere Kommentare anzeigen
X = cat(2,Z,Y);
all = [];
all = zeros(1800000,6);
all(:,1) = 0.001:0.001:1800;
el = length(X);
for i = 2:el
a = X(i,1)/0.001;
all(a,2) = X(i,2);
end
というプログラムを実行すると、「位置 1 のインデックスが無効です。配列インデックスは正の整数または logical 値でなければなりません。」というエラーが出ます。0番目にアクセスしているわけではないのになぜこのようなエラーが出るのでしょうか?
なおall = 1800000×6 double, el = 1386で i=1の時a=1.6887e+04ですのでallの行を超えていません。
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!