フィルターのクリア

Matrix condition in while loop

4 ビュー (過去 30 日間)
aero123
aero123 2020 年 9 月 17 日
回答済み: Alan Stevens 2020 年 9 月 17 日
Hi
I've been trying to use while loop with the matrix condition, but it doens't work.
I got an error message, "Index in position 1 exceeds array bounds."
Could you tell me what the problem is?
Thank you very much in advance.
for i = 1:10
EP(1,:) = EP1;
while (abs(EP(i+1,:)-EP(i,:)>0.1))
for j = 1:4
a(j) = EP(i,1) - s(j,1);
b(j) = EP(i,2) - s(j,2);
c(j) = EP(i,3) - s(j,3);
end
.
.
.
end
end

採用された回答

Alan Stevens
Alan Stevens 2020 年 9 月 17 日
I don't know if this solves your problem, but
while (abs(EP(i+1,:)-EP(i,:)>0.1))
should probably be
while abs(EP(i+1,:)-EP(i,:))>0.1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by