Use for loop in array
古いコメントを表示
How to use the for loop in array with a start value of 0?
回答 (1 件)
KSSV
2019 年 6 月 10 日
a = rand(10,1) ;
for i = 1:length(a)
a(i)
end
6 件のコメント
hang dong
2019 年 6 月 10 日
KSSV
2019 年 6 月 10 日
No..MATLAB does not accept index as zero. It should be positive integer.
hang dong
2019 年 6 月 10 日
KSSV
2019 年 6 月 10 日
What is your purpose? Explain your problem.
hang dong
2019 年 6 月 10 日
KSSV
2019 年 6 月 10 日
You can get the index of 0 using
idx = find(a==0)
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!