What is the meaning of command for(x:x1:x2) ?

5 ビュー (過去 30 日間)
Mohit Bhatia
Mohit Bhatia 2020 年 9 月 23 日
編集済み: Ameer Hamza 2020 年 9 月 23 日
What is the meaning of command that is (for (x:x1:x2)) ?

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 9 月 23 日
編集済み: Ameer Hamza 2020 年 9 月 23 日
The correct is
for i = x:x1:x2 % any variable name can be used in place of i
% The variable i takes value from vector x:x1:x2 in each iteration
end
In each iteration, MATLAB takes values from vector x:x1:x2 and assigns it to the variable i. To understand what (x:x1:x2) means, read here: https://www.mathworks.com/help/matlab/ref/colon.html

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by